Why won't my xmodmap command run on startup/login?
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Dreaming in Puzzles
--
Chapters
00:00 Why Won'T My Xmodmap Command Run On Startup/Login?
00:58 Answer 1 Score 1
01:12 Accepted Answer Score 11
01:47 Answer 3 Score 2
02:29 Thank you
--
Full question
https://superuser.com/questions/185345/w...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #ubuntu #login #boot #xmodmap
#avk47
ACCEPTED ANSWER
Score 11
~/.profile runs early in the login sequence. If your desktop environment configures a keyboard layout, it can overwrite the settings you've just loaded.
Put your settings in a file called ~/.Xmodmap:
keysym Delete = Menu
keysym Menu = Delete
Under the default Gnome environment in Ubuntu 10.04, the next time you log in, you will be prompted as to whether to load ~/.Xmodmap. Load it, and tick “don't ask me again”. Then your .Xmodmap will be applied after the default settings.
ANSWER 2
Score 2
I found that in the place in Gconf-Editor mentioned above the name of your revised keyboard layout should appear twice, once under "known_file_list" and once under "update_handlers". As to why Ubuntu sometimes puts in the latter entry, and sometimes doesn't... well, it keeps you on your toes, doesn't it?
Incidentally, after a lot of research I used the above tweak to re-assign the Left Windows key. I put the following statement in my own keyboard layout to make it duplicate the Left Arrow key:-
keycode 133 = 0xFF51
(Check that those are the right codes for you by going into xev and pressing first one key then the other.)
It's only a little point, but while I'm on the Internet it gives me a convenient "Back" key - Alt+Win with the left hand. I can do it without looking.
ANSWER 3
Score 1
Some systems look for a file named ~/.Xmodmap and execute the commands found there. Try putting these lines in that file:
keysym Delete = Menu
keysym Menu = Delete