Overclock.net banner

1 - 4 of 4 Posts

·
Premium Member
Joined
·
10,351 Posts
Discussion Starter #1
I'm running Fedora 20 and trying to get xmodmap to run at startup/login in order to swap my alt/ctrl keys.

There is apparently a bug regarding this: https://bugzilla.redhat.com/show_bug.cgi?id=873656

But one of the stated solutions is: "Adding an entry in gnome-session-properties to run xmodmap seems to work fine." And it does not. If I log out, my xmodmap settings go to hell until I run the script again manually.

I have tried the following:
  1. Put the line "xmodmap ~/.Xmodmap" in my .bashrc file
  2. Put the same line in my .bash_profile file
  3. Put my Xmodmap in /etc/X11/Xmodmap
  4. Wrote a script to execute xmodmap on my .Xmodmap file and put that script in my .bashrc
  5. Added the script as a gnome-session-properties startup command
  6. Added "xmodmap /home//.Xmodmap" to gnome-session-properties as a startup command
And none of the above works. This is bewildering. It's as if the system is inspecting every line of startup and checking if "xmodmap" exists and purposely ignoring it.

Any help is appreciated.
 

·
Premium Member
Joined
·
10,324 Posts
Have you tried .xinitrc?

Some display managers tend to ignore it... Like GDM. But it can be worth a shot. Remember each command needs a '&' at the end.
 

·
Premium Member
Joined
·
10,351 Posts
Discussion Starter #3
Doesn't seem to work, unfortunately...
 

·
Premium Member
Joined
·
10,351 Posts
Discussion Starter #4
This is absolutely unbelievable that something so simple can be this hard... Anyway, I think I've found a solution/bandage:

1. Put your Xmodmap file in /etc/gdm/ (of course, this only makes this apply to gnome.)
2. Activate the /etc/gdm/PostLogin/Default script (by renaming/copying the Default.sample file to the name Default)
3. Put the line "sleep 4 && xmodmap /etc/gdm/Xmodmap &" in the Default file.

The script will execute after you log in. The "sleep" part is because apparently keyboard settings are being set sometime AFTER login. This is why all of my efforts were seemingly being erased. I haven't figured out where that happens, yet. Anyway, the settings will be applied 4 seconds after you log in. And to anyone viewing this post from the outside, the && executes the command to the left and the right, and the & at the end says "and do it in the background" so that it doesn't actually delay your login for 4 seconds.

Enjoy...
 
1 - 4 of 4 Posts
Top