How to enable caps lock highlighting with xset?

I wrote a little fetchmail script that checks the remote server and plays the audio file when I have new mail. I also wanted to light one of my keyboard lights when mail was available, but I ran into a problem. I can light the scroll lock light as follows:

/usr/bin/xset led named "Scroll Lock" 

But I can’t enable caps lock the same way:

 /usr/bin/xset led named "Caps Lock" 

I tried to specify the key with the number (1-6), but despite changing the mysterious "LED mask" (visible with "xset q"), I did not see any changes in the light.

Is it broken because I matched my Caps Lock key as another Ctrl?

In ~ / .Xmodmap I have:

 keycode 66 = Control_L clear Lock add Control = Control_L 

I do not want to switch to a lock, just to the light. Is there any way to do this?

Further explanation

This is on an explicit x86 kubuntu machine, but later I will switch to debian. I am running the script as an unprivileged user in the python daemon. Running the same script as root will not work, because fetchmail is configured for me as a user. And finally, all this is done in a tmux session.

When I started this process, I read about the settings, but it seems to be limited to terminals in non-sessions.

Logging in as root and running 'setleds -D + caps </ dev / tty7' works, but running 'sudo setleds -D + caps </ dev / tty7' gives me permission to reject the error.

The xset command seems perfect for my application, it just refuses to change the Caps Lock highlight.

+8
keyboard capslock
source share
2 answers

Run as root:

setleds -D +caps < /dev/console

Hackish but works for me :)

+10
source share

Do xset need to be xset ? Have you ever used setleds ?

 setleds -D +caps setleds -D -caps 

Short Review: Linux / Unix Command: setleds

+1
source share

All Articles