Created
November 2, 2015 18:32
-
-
Save hunner/56ce8cb282045611cf66 to your computer and use it in GitHub Desktop.
xbacklight shell script replacement for gmux (ie, apple macbook pro)
This file contains 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
#!/bin/sh | |
brightness=$(cat /sys/class/backlight/gmux_backlight/brightness) | |
if [ $1 = '-inc' ] ; then | |
newbrightness=$(expr $brightness + $2 \* 3) | |
elif [ $1 = '-dec' ] ; then | |
newbrightness=$(expr $brightness - $2 \* 3) | |
fi | |
if [ $newbrightness -lt 0 ] ; then | |
newbrightness=0 | |
fi | |
echo $newbrightness | sudo tee /sys/class/backlight/gmux_backlight/brightness > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment