Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I disable the keyboard backlight, by turning it completely off, on a Macbook in 12.04?

Whenever I reboot, Ubuntu sets the backlight to 100% brightness, and frustratingly the new function keys no longer support being held down, so I have to press the dim key about 50 times to turn off the backlight.

share|improve this question
Check… – naught101 Oct 12 '12 at 11:26
@naught101, You linked to this question... – Cerin Oct 12 '12 at 16:40
SOrry, I meant… – naught101 Oct 13 '12 at 0:03
up vote 5 down vote accepted

Make the keyboard backlight device writable by everyone:

sudo chmod 777 /sys/class/leds/smc::kbd_backlight/brightness

Then, in your ~/.bash_aliases, add:

echo 0 | tee -a /sys/class/leds/smc::kbd_backlight/brightness

Alternatively, if you want the backlight to be disabled for all users, then add that line instead to /etc/profile.d/

The only caveat I've noticed is that unlocking your screen occassionally appears to reset the backlight to full brightness. Unfortunately, I don't know what's causing this.

share|improve this answer
Does this disable the keyboard backlight or just set it to a default of 0 (so the user can actually raise it on occasion)? – Waldir Leoncio Oct 25 '14 at 0:33
The later. The user can still change it, by either using the brightness keys (assuming the mapping is correct) or using the command above but changing the 0 to a value between [0:255]. – Cerin Oct 25 '14 at 14:02

(I know this is pertaining to ubuntu but thought it might be helpful to those running Mint as well)

Trying to add these to the bash aliases didn't work for me on Linux Mint running on a Macbook Air 2012 (probably doing something wrong).

I had to run a script as sudo at login

echo '2' > /sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness
echo '0' > /sys/devices/platform/applesmc.768/leds/smc::kbd_backlight/brightness
exit 0

See: how to run script as sudo at login

  1. I created a shell script in ~/subfolder/ with the script from above.

  2. Then had to edit the sudoers file and enable the custom script to run without a password.

    username ALL=NOPASSWD:/full/path/to/
    # Replace username and path with your own
  3. Then basically just added

    sudo /full/path/to/

    to startup applications.

This is explained in the link.

Any suggestions for improvement would be appreciated, but this works for me.

share|improve this answer
This works as well on Asus Zenbook Prime, just use a command echo 0 > /sys/class/leds/asus\:\:kbd_backlight/brightness. Btw you can edit the sudoers file using sudo visudo – tsusanka Sep 24 '13 at 9:18

Your Answer


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.