How to get Keyboard Light keys working on Macbook?

I've got a Macbook Pro with Keyboard Light brightness keys. How to I make them work?

3 Answers

Add the mactel PPA by following these instructions.

Install packages applesmc-dkms and hid-dkms.

Reboot.

sudo vi /usr/local/bin/keyboard-backlight and add:

#!/bin/bash
VALUE=$(cat /sys/class/leds/smc::kbd_backlight/brightness)
INCREMENT=32
TOTAL=unset
case $1 in
up) TOTAL=`expr $VALUE + $INCREMENT` ;;
down) TOTAL=`expr $VALUE - $INCREMENT` ;;
full) TOTAL=255 ;;
off) TOTAL=0 ;;
esac
if [ $TOTAL == unset ]; then echo "Please specify up, down, full, or off" exit 1
fi
if [ $TOTAL -gt 255 ]; then TOTAL=255; fi
if [ $TOTAL -lt 0 ]; then TOTAL=0; fi
echo $TOTAL > /sys/class/leds/smc::kbd_backlight/brightness

Followed by sudo chmod 755 /usr/local/bin/keyboard-backlight.

sudo visudo and add the line:

your_username_goes_here ALL=NOPASSWD:/usr/local/bin/keyboard-backlight up, /usr/local/bin/keyboard-backlight down

Go to System > Preferences > Keyboard Shortcuts.

Add new shortcuts:

Increase Keyboard Backlight Brightness/sudo keyboard-backlight up and

Decrease Keyboard Backlight Brightness/sudo keyboard-backlight down.

Set each to the correct key by clicking the key mapping box and pressing the key.

3

Install the latest Ubuntu release - 11.04 - Natty Narwhal - and keyboard backlight should work out of the box -

Use "pomme". It is redundant (three programs all pop up to tell you that you increased your volume!), annoying, and doesn't work for me for this anyway (no effect). However, others swear by it. (Please edit this for how to make it work if you know. Bonus for turning off the redundant parts.)

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like