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'm running Ubuntu 13.10. When I remap keys using xmodmap using the instructions at How do I remap certain keys? , the remapping works fine. But when I create the .xinitrc file as a plain text file with xmodmap .Xmodmap in the home folder, and restart the computer, I still lose the changes. I've also tried xmodmap ~/.Xmodmap but that made no difference. When I simply run xmodmap .Xmodmap in the command after booting, it does work. Any ideas?

share|improve this question
up vote -1 down vote accepted

You can make a script, to run each time you login.

  • Create an empty .sh file
  • Input your code inside. It can look like this:
# This is my remapping to change AltGr with W. Edit it to work with yours.
sleep 25
xmodmap -e "remove mod1 = Alt_R"
xmodmap -e "keycode 108 = w W Cyrillic_ve Cyrillic_VE"
  • Make it executable.

  • Add it to Application Autostart tab of Session and Startup.

share|improve this answer
That does it - thank you. – Shane Feb 3 '14 at 18:09

Try creating .xsessionrc instead. .xinitrc is only used by xinit, I believe - when X is started by a display manager like lightdm or gdm, I don't think it is sourced.

share|improve this answer

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.