The i3 FAQ has migrated to All content here is read-only.
Ask Your Question

i3bar/i3status: Is it possible to have Caps-Lock and Num-Lock indicator ?

asked 2013-02-25 21:40:00 +0000

syl20bnr gravatar image

updated 2013-03-07 05:34:56 +0000

Question is in the title :)



EDIT: an i3status wrapper can be found here:

edit retag flag offensive close merge delete

3 answers

Sort by » oldest newest most voted

answered 2013-03-05 15:30:21 +0000

MeanEYE gravatar image

updated 2013-03-05 15:53:58 +0000

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.

edit flag offensive delete link more



Thank you for your great support. The result script is here:

syl20bnr gravatar imagesyl20bnr ( 2013-03-07 05:33:02 +0000 )edit

Awesome. :D

MeanEYE gravatar imageMeanEYE ( 2013-04-08 20:21:08 +0000 )edit

answered 2013-04-26 01:35:16 +0000

demil133 gravatar image

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

edit flag offensive delete link more


Nice trick! Although it seems to be buggy if num lock and caps lock are both activated.

syl20bnr gravatar imagesyl20bnr ( 2013-07-30 02:53:56 +0000 )edit

Been wanting this for ages, thanks.

massysett gravatar imagemassysett ( 2014-02-04 19:39:16 +0000 )edit

answered 2013-02-27 22:33:02 +0000

Michael gravatar image

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.

edit flag offensive delete link more


And what about pressing both shift keys? Should be the same.

frakturfreak gravatar imagefrakturfreak ( 2013-04-26 22:54:52 +0000 )edit

Question Tools


Asked: 2013-02-25 21:40:00 +0000

Seen: 2,338 times

Last updated: Apr 26 '13