Last active
March 5, 2019 02:55
Change backlight settings in Fedora 29 MATE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
CURRENT_LEVEL=$(pkexec --user root mate-power-backlight-helper --get-brightness) | |
if [ $1 == "get" ]; then | |
echo -e "\nCurrent Level: $CURRENT_LEVEL\n" | |
exit 0 | |
elif [ -z $1 ] || [ -z $2 ]; then | |
echo -e "\nUSAGE: change-backlight <inc|dec|set|get> [<val>]\n" | |
exit 0 | |
fi | |
if [ $1 == "inc" ]; then | |
if ! [ $(($CURRENT_LEVEL + $2)) -ge "1060" ]; then | |
NEW_LEVEL=$(($CURRENT_LEVEL + $2)) | |
pkexec --user root mate-power-backlight-helper --set-brightness $NEW_LEVEL | |
else | |
pkexec --user root mate-power-backlight-helper --set-brightness 1060 | |
fi | |
elif [ $1 == "dec" ]; then | |
if ! [ $(($CURRENT_LEVEL - $2)) -le "0" ]; then | |
NEW_LEVEL=$(($CURRENT_LEVEL - $2)) | |
pkexec --user root mate-power-backlight-helper --set-brightness $NEW_LEVEL | |
else | |
pkexec --user root mate-power-backlight-helper --set-brightness 1 | |
fi | |
elif [ $1 == "set" ]; then | |
if ! [ $2 -ge 1060 ] && ! [ $2 -le 0 ]; then | |
NEW_LEVEL=$2 | |
pkexec --user root mate-power-backlight-helper --set-brightness $NEW_LEVEL | |
elif ! [ $2 -ge 1060 ]; then | |
pkexec --user root mate-power-backlight-helper --set-brightness 1 | |
else | |
pkexec --user root mate-power-backlight-helper --set-brightness 1060 | |
fi | |
else | |
echo -e "\nUSAGE: change-backlight <inc|dec|set|get> [<val>]\n" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inspiration:
xbacklight
working... lost patience decided to do it myself using the MATE tools (which i could get working).Instructions:
/usr/local/bin/
Add HotKeys: