i3bar/i3status: Is it possible to have Caps-Lock and Num-Lock indicator ?
Question is in the title :)
Cheers,
Sylvain
EDIT: an i3status wrapper can be found here: github.com/syl20bnr/i3status-keyboard-leds
Question is in the title :)
Cheers,
Sylvain
EDIT: an i3status wrapper can be found here: github.com/syl20bnr/i3status-keyboard-leds
It's not an easy way to achieve this, but it's not impossible either. You can use xset
command. If you issue the following command:
$ xset q
Keyboard Control:
auto repeat: on key click percent: 0 LED mask: 00000000
XKB indicators:
00: Caps Lock: off 01: Num Lock: off 02: Scroll Lock: off
...
As you can see you have LED mask
which is bitmask of active flags, or you can parse strings from 00: Caps Lock: off
.
So, what you need to do is make a wrapper script. You can see how this is done here.
After you have a wrapper script then configure your i3 status command to point to your script directly and that's about it. You combine output of i3status
with strings you parse.
Thank you for your great support. The result script is here: https://github.com/syl20bnr/i3status-keyboard-leds
I've got this on my ~/.i3/config
:
# Enable/disable caps mode
mode "caps" {
bindsym Caps_Lock mode "default"
}
bindsym Caps_Lock mode "caps"
# Enable/disable numeric keyboard
mode "num" {
bindsym Num_Lock mode "default"
}
bindsym Num_Lock mode "num"
This will show an indicator like the "resize" one if you press $mod+r
for me this disables some keybindings I've got on my numeric keyboard so that I can use it for it's original purpose
No, there is no such feature built in. My computer has LEDs for that. Also, in my keyboard layout, I don’t have caps lock. If you want such an indicator, you have to wrap i3status with a custom script, see its manpage.
And what about pressing both shift keys? Should be the same.
Asked: 2013-02-25 21:40:00 +0000
Seen: 2,337 times
Last updated: Apr 26 '13