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 Mactel
Support, which is the registrant for Mactel Support.
Status in Hardware Abstraction Layer (HAL): New
Status in Mactel Support: In Progress
Status in “linux” package in Ubuntu: Incomplete
Bug description:
The keyboard backlight on the MacBook 5.1 is not supported as of Jaunty (Ubuntu
9.04) Alpha 5. This is supported in Intrepid (Ubuntu 8.10) by the Mactel PPA
packages hal-applesmc, hid-dkms, and possibly nvidia-bl-dkms, though I
installed the nvidia-bl-dkms package for Jaunty.
_______________________________________________
Mailing list: https://launchpad.net/~mactel-support
Post to : [email protected]
Unsubscribe : https://launchpad.net/~mactel-support
More help : https://help.launchpad.net/ListHelp