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

I am using Keyboard Layouts Plugin to switch between two layouts.

I want to remap Caps Lock to underscore "_"

First I empty Caps Lock, or otherwise caps lock will do both – toggle caps and produce underscore character and then map caps lock to underscore

xmodmap -e "keycode 66 = "
xmodmap -e "keycode 66 = underscore"

Problem? This resets every time I log out or change something in Keyboard Layouts Plugin preferences. I want this to be permanent.

share|improve this question
See if this question helps: How can I change what keys on my keyboard do? – Aditya Apr 1 '13 at 10:44
@Aditya - I want to know how to remap a key permanently so that xfce doesn't reset it. That link does not address this issue. – Guesthwere Apr 1 '13 at 11:14
Try the other suggestions given - xbindkeys, xev, etc along with xmodmap. I am sure they are written in a way that would bind the keys permanently. That question is pretty comprehensive. If you still face the issue, please update the question. – Aditya Apr 1 '13 at 11:17
@Aditya - setxkbmap -option caps:underscore <-- why doesn't this do anything? – Guesthwere Apr 1 '13 at 11:54
I won't be able to help you on this. I have no idea about the stuff. Neither can I find that code (setxkbmap -option) in any of the answers to that question. I would suggest you to edit your question to include what problems you are facing. – Aditya Apr 1 '13 at 12:04

Your Answer


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

Browse other questions tagged or ask your own question.