1

Thinkpad T440S running Ubuntu 20.04 with MATE desktop (not Ubuntu MATE flavor).

At boot the keyboard backlight is off, but when the user logs in, it comes on full bright. I want it to be off without requiring user interaction.

This question Keyboard backlight turns on by itsself, Lenovo T440s has an accepted answer, but the file that it says to modify does not exist on this system.

This unanswered question Keyboard backlight at login screen has a command xset in it that looks useful, but I can't find a way to list the devices that it can control.

I found this command

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

which works, but only if I do use sudo like

sudo sh -c 'echo 0 > /sys/class/leds/tpacpi\:\:kbd_backlight/brightness'

which would require the user to enter a password.

How can I set the keyboard backlight off at user login on this system without requiring user interaction?

(PS - The keyboard shortcut Fn+Spacebar works, but that isn't the point)

1 Answers1

1

I accomplished the goal by putting

sudo sh -c 'echo 0 > /sys/class/leds/tpacpi\:\:kbd_backlight/brightness'

in a script.

I added this script to the sudoers file using the method in this answer:

How do I run specific sudo commands without a password?

I then added the script to System/Preferences/Personal/Startup Applications so that it runs at login. The user is not prompted for a password due to the script being in the sudoers file.

This has the desired effect of turning off the keyboard backlight when the user logins. It can be turned back on using the Fn+Spacebar key combination if desired.