Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

A linux newbie here! I own a netbook which doesn't have any indicator leds. So I decided to write a small shell script that would notify me when the capslock key is pressed. The script goes something like this:

state=$(xset -q | grep Caps | awk '{print $4}')
if [ "$state" = "on" ]
notify-send "Caplock :ON"

Now I want to bind the script to the capslock key so that it gets executed everytime I press the key. But the keyboard shortcuts setting expects a key combination. Is it possible to bind it to just the capslock key??

Thanks in advance!

share|improve this question

Have a look at this forum post. It may be able to help you assuming you're using Unity. You'll have to install compizconfig-settings-manager first though.

share|improve this answer
Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – RolandiXor Jan 4 '13 at 18:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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