2

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
2
{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.

  • 1
    Very nice! I tweaked it a bit to have: ${execpi 1 xset q | grep "Caps Lock:" | awk '{if ($4 == "on") {print "${blink ${color red}ON${color}}"} else {print "OFF"}}'} – Warnaud Jul 14 '16 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.