Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

Is it possible to set caps lock to switch between inserting numbers and the symbols they normally trigger when one holds shift?

e.g. when you normally press the 9 key, you get a ( unless caps lock is on.

I tried adding this line to my layout file, on /usr/share/X11/xkb/symbols:

key <AE05> {        [ percent, 5 ]       };

This effectively switches the 'normal' and 'shift' meanings, but it won't work on caps lock - only on shift.

share|improve this question
up vote 15 down vote accepted

Use the following command:

setxkbmap -option caps:shiftlock
share|improve this answer
Amazing, thank you angus! – vemv May 19 '12 at 15:56
Excellent idea! – nikhil May 25 '12 at 12:01
Perfecto thanks – Steve Muster Mar 29 '14 at 17:26

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.