[Bug 337945] Re: [Jaunty] MacBook 5.1 keyboard backlight not supported

Peter S. stoto at stoto.net
Sun May 9 17:59:01 UTC 2010


I found a solution:

I made a script, with that i can control the brightness:

stoto at stoto-laptop:~$ cat backlight.sh 
#!/bin/bash

$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
		fi
	;;

	dec)
		if [[ $act -gt 4 ]]; then
                        act=$((act-5))
                        echo $act | tee /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
                fi
	;;

	*) echo "Usage: inc or dec"
	;;
esac

Save the script somewhere. I saved in my home, and made a symlink to /bin/backlight.sh but its optional
I binded it to the brightness control keys in:

System -> Preferences -> Keyboard Shortcuts

Make 2 Custom shortcuts with the add button:
-BrightnessUp, command: /bin/backlight.sh inc
-BrightnessDown, command: /bin/backlight.sh dec

This is only working if you have access to the brightness control file.
Putting sudo in the command won't work, it works with gksudo, but then
you will have massive amounts of windows popping up when you hold the
brightness control key.

So the best solution i found:
sudo chmod 777 /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness

It works like a charm.

-- 
[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 Kernel
Bugs, which is subscribed to linux in ubuntu.




More information about the kernel-bugs mailing list