Created
April 27, 2017 18:55
-
-
Save voutilad/fd826ff9e63a5cc9ef08eff9330c989a to your computer and use it in GitHub Desktop.
Backlight brightness control for MacBook Air 11" on Gentoo using Intel driver. (Adapted from https://wiki.gentoo.org/wiki/Apple_Macbook_Pro_Retina_(early_2013)#Display_backlight)
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/bash | |
bldb='/sys/class/backlight/intel_backlight/brightness' | |
step=113 | |
current=`cat $bldb` | |
new=$current | |
if [ "$1" == "up" ];then | |
new=$(($current + $step)) | |
elif [ "$1" == "down" ];then | |
new=$(($current - $step)) | |
fi | |
if [ $new -le 0 ];then | |
new=0 | |
fi | |
echo $new > $bldb | |
current=`cat $bldb` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not sure if it's a good idea, but can
chgrp wheel
that file and andchmod g+w
to allow users in wheel group to write to it. Make sure tochmod g+x bl-brightness