I have my Caps Lock key remapped to Esc, so now I have a LED on my keyboard that is never on. I'd like to use it for something useful, like HDD or LAN activity.
Especially that I'm using a computer with a custom box & heatsinks (built into my drawer so I don't have to listen to the HDD and it doesn't take up much space), and the LEDs are not visible otherwise.
If there's a library for controlling the keyboard LEDs, I could do some coding myself, if there isn't a solution for this already.
I'm on Gentoo ~amd64.
EDIT: Ok, forget about the HDD LED. It was just an example.
I want the Caps Lock LED to light up when it's my birthday. Or when I have email. Or when I say "Caps Lock LED, please light up!".
I absolutely do not want to use an extra wire. In fact, it would be nice if this would work on wireless keyboards as well.
Best Answer
Well to change the led indicator on VT console you can use
setleds
. So if you're in a VT you can just typeand you'll get your current led status. If you don't want to enable numlock, just light it up you can type:
It comes trickier in X and this is the "simplest" way to try it. Please note that X is usually ran as root so you'll either have to check permissions on X-windows tty or run it with root privileges. Usually X is tty7.
/dev/console
should work being the system console and by that all VTs should be affected.I think this will also work:
here's list of light options
If you don't have
setleds
in you system, my guess is that you can get it from this emerge packagesys-apps/kbd
.If you are more of person who likes to code stuff here's a link to en example code to change leds in X. I did not test this, but just by looking the code looked ok.
And here's a shell script to do what you originally wanted. To have caps or other leds as HDD indicators.