Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
add comment

2 Answers 2

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:
#!/bin/bash
# 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 at 18:09
add comment

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
add comment

Your Answer

 
discard

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.