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.

Some Lenovo laptops have keyboard backlights, and they can be turned on using Fn + Space. There are three states: off, normal and bright.

When I start Ubuntu, these laptops always default back to a burning sun screen brightness and the keyboard lights off.

I want a medium brightness and keyboard lights on by default, because I usually use this laptop in dark environments.

The backlight is easy. Internet is filled with information about this.
echo 10 > /sys/class/backlight/acpi_video0/brightness

But how do I turn on the keyboard backlights with a command? I've been looking here but it seems to do nothing:
/sys/class/leds/tpacpi\:\:thinklight


Updates

I tried for i in {1..32}; do xset led $i; done but nothing changes. Perhaps the keyboard backlight for Lenovo laptops has a proprietary driver and can only be controlled through tpacpi?

Also tried for i in $(find /sys/devices/platform/thinkpad_acpi/leds/ | grep /brightness\); do echo 255 > $i; done of no avail.

share|improve this question
    
Either xset led (that is almost 100% likely to be Caps Lock, etc, but I'll add it in anyway) or setleds. Edit: Found this –  Wilf Nov 28 '13 at 19:32
    
It doesn't work. I tried for i in {1..32}; do xset led $i; done but nothing changes. –  Redsandro Nov 28 '13 at 23:29

2 Answers 2

Ok, it works fine with me with this gist:

https://gist.github.com/hadess/6847281

  • First of all download the gist above, I renamed it to ThinkLight.c instead of tmp.c.
  • Make sure you have glib-2.0 installed:

    sudo apt-get install libglib2.0-dev
    
  • Compile ThinkLight.c as the following:

    gcc -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include ThinkLight.c -o ThinkLight -lglib-2.0
    
  • Load ec_sys module ( this can be added to /etc/modules on boot ):

    sudo modprobe ec_sys
    
  • Finally execute ThinkLight with level argument (0, 1, or 2):

     sudo ./ThinkLight 0
     sudo ./ThinkLight 1
     sudo ./ThinkLight 2
    

Special thanks to hadess for making this happen!

share|improve this answer

This is really needed to be fixed!

I think this is a common bug in new thinkpads. If you light keyboard manually fn + space then executed:

echo 0 > /sys/class/leds/tpacpi\:\:thinklight/brightness

keyboard will fade out. Please see the following link if it helps:

http://www.spinics.net/lists/ibm-acpi-devel/msg03090.html

share|improve this answer
    
Hey you're right, I didn't know. Since we can turn it off, it 'feels' like it would be a piece of cake to fix this for developers. Is there a bugreport yet? –  Redsandro Dec 29 '13 at 16:11
    
The email suggested this workaround: gist.github.com/hadess/6847281 Any idea how can we implement it ? –  rashad Dec 29 '13 at 17:14

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.