$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
I found a solution:
I made a script, with that i can control the brightness:
stoto@stoto- laptop: ~$ cat backlight.sh
#!/bin/bash
$act platform/ applesmc. 768/leds/ smc::kbd_ backlight/ brightness` platform/ applesmc. 768/leds/ smc::kbd_ backlight/ brightness
act=`cat /sys/devices/
echo $1
case "$1" in
inc)
if [[ $act -lt 255 ]]; then
act=$((act+5))
echo $act | tee /sys/devices/
fi
;;
dec)
act= $((act- 5))
echo $act | tee /sys/devices/ platform/ applesmc. 768/leds/ smc::kbd_ backlight/ brightness
if [[ $act -gt 4 ]]; then
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: platform/ applesmc. 768/leds/ smc::kbd_ backlight/ brightness
sudo chmod 777 /sys/devices/
It works like a charm.