Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
102
rated 0 times [  102] [ 0]  / answers: 1 / hits: 77938  / 2 Years ago, mon, july 25, 2022, 9:25:11

I cannot make xmodmap run on login in Ubuntu 13.04. I have searched around, including in askubuntu and all answers I found do not work.



I have a file named .Xmodmap in my home folder which contains the desired mappings. If I run it manually it works fine, so there is no error there. In order to make it run on startup, I have tried:




  1. Using various .xinitrc containing one of the following commands:




    • xmodmap .Xmodmap

    • xmodmap ~/.Xmodmap

    • /usr/bin/xmodmap /home/NAME/.Xmodmap

    • if [ -s ~/.Xmodmap ]; then

      xmodmap ~/.Xmodmap

      fi


  2. Using .Xresources instead of .xinitrc with the same variations.


  3. Setting it as a startup application.




None of the above works in Ubuntu 13.04 (64-bit). I also saw a few ideas about globally changing the keyboard mappings, but most of them were not applicable in Ubuntu 13.04 (i.e. the corresponding files did not exist where specified) and I prefer not to touch the global settings anyway.


More From » 13.04

 Answers
6

Ubuntu no longer uses xmodmap, but instead uses xkb (as far as I understand, this facilitates per-window keyboard layouts, among other things).



The system-wide map files are in



/usr/share/X11/xkb/symbols/


The maps appears to be loaded hierarchically, with the pc map as the root, and whatever language (e.g. en) as a child of the root.



In my particular case, I physically swapped Page Up with Home and Page Down with End on my keyboard, so I very crudely made changes to the system-wide pc map, as follows:



 key <HOME> {    [  Prior        ]   };
key <PGUP> { [ Home ] };
key <END> { [ Next ] };
key <PGDN> { [ End ] };


NOTE: To force Xorg to use your new keyboard map, you may have to remove the existing pre-compiled maps (*.xkm) in



/var/lib/xkb/


and then restart Xorg.



There are various resources on xkb, but this one is related to Ubuntu.


[#30182] Monday, July 25, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
tonhorn

Total Points: 196
Total Questions: 118
Total Answers: 95

Location: Vanuatu
Member since Fri, May 13, 2022
2 Years ago
tonhorn questions
Tue, May 10, 22, 12:01, 2 Years ago
Sat, Dec 18, 21, 06:23, 2 Years ago
Thu, Jun 16, 22, 04:03, 2 Years ago
Fri, Apr 1, 22, 05:23, 2 Years ago
;