Score:1

Disable Keyboard Backlight on Thinkpad T440S at login

dj flag

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)

Yuri Sucupira avatar
cn flag
Does [this answer](https://unix.stackexchange.com/a/625650/143980) help you?
Score:1
dj flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.