Ubuntu – Caps-lock indication with conky

conkyxubuntu

I have laptop without Caps Lock indicator.
I'd like to have this indicator in conky.
Which conky option can help me to get status of Caps-Lock?

  • OS: Xubuntu 12.04.
  • Conky 1.8.1

Best Answer

{color ffff00}${exec xset q | grep "Caps Lock:   on" | awk '{print $4}'}${color}

works for me.

Please note that having too many exec in your Conky could increase demand on your system resources.

Also, how soon you see "on" depends on the frequency of updating. In other words, it will depend on the value you have set. I update every two seconds:

update_interval 2.0

You may also want to position where "on" appears but that will depend on the rest of your Conky code. For example, what values of gap_x and gap_y you set. I have my minimal Conky at the top of the screen and I use

gap_x 3
gap_y 4

along with

${goto 500}

prepended to the the actual code so that "on" appears near the top center of my screen.

Related Question