Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

share|improve this question
add comment

3 Answers 3

Install the latest Ubuntu release - 11.04 - Natty Narwhal - and keyboard backlight should work out of the box - https://bugs.launchpad.net/ubuntu/+source/gnome-power-manager/+bug/724324

share|improve this answer
add comment
up vote 4 down vote accepted

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.

share|improve this answer
    
Thanks, Jorge! It works with my Macbook Air (Early 2014) in Xubuntu 14.04 LTS. Thanks again! :) –  Manuel Ignacio López Quintero May 18 at 17:44
    
Actually, I wrote this. It is out of date, though. –  A Student at a University Jul 3 at 11:42
add comment

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.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.