I had to make a little modification for the script so it will work after
reboot too:
st...@stoto-laptop:~$ cat backlight.sh
#!/bin/bash
if [ `ls -al
/sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness | awk
{'print $1'}` != -rwxrwxrwx ]; then
gksudo chmod 777
/sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
fi
$act
act=`cat /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness`
echo $1
case "$1" in
inc)
if [[ $act -lt 255 ]]; then
act=$((act+5))
echo $act | tee
/sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
#else
#notify-send -t 50 "Keyboard backlight is on maximum!"
fi
;;
dec)
if [[ $act -gt 4 ]]; then
act=$((act-5))
echo $act | tee
/sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
#else
#notify-send -t 50 "Keyboard backlight is off."
fi
;;
*) echo "Usage: inc or dec"
;;
esac
The else and the notify-send is commented out, because of a bug in notify-osd
package. This bug causes notify-osd to ignore the timeout settings.
--
[Jaunty] MacBook 5.1 keyboard backlight not supported
https://bugs.launchpad.net/bugs/337945
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs