Enable the keyboard backlights on supported Lenovo (e.g. Carbon X1) with command

91,156

Solution 1

Looks as this has been updated, my X1C with ubuntuMATE 16.04 LTS has

/sys/class/leds/tpacpi\:\:kbd_backlight/brightness

which works as expected ie:

# echo 2 > /sys/class/leds/tpacpi\:\:kbd_backlight/brightness

Brings it to full light :)

Solution 2

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

Solution 3

This is the bash script I use:

https://gist.github.com/vzaliva/0adba7bc40e2f31a0b5f802af2a63267

Works on IBM ThinkPad X260 with Ubuntu 16.04.

Solution 4

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!

Solution 5

My T450s would not re-enable keyboard backlight upon resume with kernels older then 4.6. FWIW, with 4.6 now, keyboard backlight is set to the brightness it had before suspend.

Share:
91,156

Related videos on Youtube

Redsandro
Author by

Redsandro

Lazy Media Creator #SOreadytohelp

Updated on September 18, 2022

Comments

  • Redsandro
    Redsandro over 1 year

    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.

    • Wilf
      Wilf over 10 years
      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
    • Redsandro
      Redsandro over 10 years
      It doesn't work. I tried for i in {1..32}; do xset led $i; done but nothing changes.
    • alamar
      alamar almost 3 years
      Thank you for the Fn-space combo since I could not figure it out for quite some time.
  • Redsandro
    Redsandro over 10 years
    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?
  • rashad
    rashad over 10 years
    The email suggested this workaround: gist.github.com/hadess/6847281 Any idea how can we implement it ?
  • zsquare
    zsquare almost 9 years
    Any idea how to run this without sudo? Trying to run this within another script, and that runs as my user.
  • Redsandro
    Redsandro almost 8 years
    IBM? That laptop has got to be at least 10 years old! But it works on my Carbon X1, too! To be fair, the code from hadess as answered by rashad did the same, but I don't want to take 5 steps and install compilers. I was looking for a simple bash command. And this is something I can use. Thank you for responding to my 3 year old question. Accepted.
  • krokodil
    krokodil almost 8 years
    Glad you found it useful. Of course I have meant Lenovo Thinkpad and my X260 is brand new. I just had the same problem and found this answer, but I did not like C program which also requires manual modprobe, so I re-wrote it as a script. The original C program authors did all heavy-lifting.
  • wuxmedia
    wuxmedia almost 8 years
    No probs, it was the first hit when I was looking, thought it can't be that hard, so thought I should update this one with my findings :)
  • Heriberto Juarez
    Heriberto Juarez almost 5 years
    I tried this and got some errors :( ThinkLight.c: In function ‘main’: ThinkLight.c:56:6: warning: implicit declaration of function ‘lseek’ [-Wimplicit-function-declaration] if (lseek (fd, 0xd, SEEK_CUR) < 0) { ^~~~~ ThinkLight.c:60:6: warning: implicit declaration of function ‘write’ [-Wimplicit-function-declaration] if (write (fd, &levels[level], 1) < 0) { ^~~~~
  • rashad
    rashad almost 5 years
    @HeribertoJuarez this is an old answer, you can manipulate this directly with the new Linux kernels. Check wuxmedia's answer
  • Admin
    Admin almost 2 years
    Thank you. Works in 2022 just as good :)