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.
5 Answers
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/brightnesskeyboard will fade out. Please see the following link if it helps:
2Looks as this has been updated, my X1C with ubuntuMATE 16.04 LTS has
/sys/class/leds/tpacpi\:\:kbd_backlight/brightnesswhich works as expected ie:
# echo 2 > /sys/class/leds/tpacpi\:\:kbd_backlight/brightnessBrings it to full light :)
2This is the bash script I use:
Works on IBM ThinkPad X260 with Ubuntu 16.04.
3Ok, it works fine with me with this gist:
- First of all download the gist above, I renamed it to
ThinkLight.cinstead oftmp.c. Make sure you have glib-2.0 installed:
sudo apt-get install libglib2.0-devCompile
ThinkLight.cas 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.0Load
ec_sysmodule ( this can be added to/etc/moduleson boot ):sudo modprobe ec_sysFinally execute
ThinkLightwith level argument (0, 1, or 2):sudo ./ThinkLight 0 sudo ./ThinkLight 1 sudo ./ThinkLight 2
Special thanks to hadess for making this happen!
3My 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.