Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to execute this code on every login:

xmodmap -e 'clear Lock' -e 'keycode 0x42 = Escape'

I tried to put this command into ~/.xsession or ~/.xinitrc but that doesn't work for me. In which file do I have to put this command?

I am using Gnome with Fedora 16.

Thanks for your help!

share|improve this question

migrated from stackoverflow.com Dec 5 '11 at 6:28

This question came from our site for professional and enthusiast programmers.

    
does it work if you just type it in the terminal? –  Maxim Yegorushkin Dec 4 '11 at 13:03
    
yes, that works –  its-me Dec 4 '11 at 19:00

2 Answers 2

up vote 0 down vote accepted

Create a file ~/.config/autostart/xmodmap.desktop with the following contents:

[Desktop Entry]
Type=Application
Name=xmodmap
Exec=xmodmap -e 'Clear Lock' -e 'keycode 0x42 = Escape'

GNOME should then run that command on all subsequent logins.

share|improve this answer
    
with the line Type=Application it works. Thank you! –  its-me Dec 6 '11 at 22:40
    
@its-me: Sorry about that; I'll fix it for future readers. Glad you got it working! –  Patches Dec 7 '11 at 19:12

Since your using GNOME your probably using GDM and alternatively you can use

/etc/gdm/PostLogin/Default

see here for details

share|improve this answer

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.