Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CapsLock, NumLock, Insert, how to show keyboard status on screen when keyboard has no LED

Tags:

linux

keyboard

When keyboard has no LED, for Linux machine, is there an easy way to do this? By Command Line, Python, Perl or Ruby, to show when keyboard has CapLock, NumLock activated?

like image 930
Andrew_1510 Avatar asked Dec 21 '22 23:12

Andrew_1510


1 Answers

If you want to use the command line to check led status use:

xset q | grep LED

This will return a number resulting from the binary addition of the led status lights. Caps lock is the first bit, Numlock is the second... the rest you need to experiment as I have only used those two.

like image 127
Bruno Regno Avatar answered Dec 24 '22 00:12

Bruno Regno