3

I use the programmer Dvorak keyboard and Ubuntu changed the layout between 13.04 and 14.04 (did not use 13.10). They changed the right Alt to be something else, not even sure what it is. Consequently, I cannot use it for Emacs, changing workspaces, windowed screenshots etc. Here is the image of what they changed it to:

keyboard layout

I want to do exactly what this post documents but changing the right Alt to be the left Alt. My real question is what do I replace keycode 66 and Shift_L to be in this command:

xmodmap -e "keycode 66 = Shift_L NoSymbol Shift_L"

I assume Shift_L would be instead Alt_L (or maybe even Alt_R to restore the 13.04 setting).


I ran :

xmodmap -pke > .xmodmap

then opened up the .xmodmap file and found the line:

keycode  92 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift

which I looked like the right Alt. Running:

xmodmap -e "keycode 92 = Alt_R Meta_R Alt_R Meta_R" 

did not change the right Alt but it did mess up the left Alt, though I am not sure about the specifics. I reset that to its original value ISO_Level3_Shift NoSymbol ISO_Level3_Shift.

Reading this post I saw mention of remapping keycode 108 as the Alt key. Running :

xmodmap -e "keycode 108 = Alt_R Meta_R Alt_R Meta_R"

did restore the right Alt to behave as an Alt key.

I am still not sure how to get the settings to persist after rebooting. I tried regenerating the .xmodmap file (xmodmap -pke > .xmodmap) then created the ~/.xinitrc with the line:

xmodmap .xmodmap

When I reboot, the ~/.xinitrc file was not executed. By simply running the command

xmodmap ~/.xmodmap

the changes were restored.

I also tried adding the command xmodmap ~/.xmodmap to the startup programs and it does restore the setting when rebooting.

Lastly, I tried editing the cron task:

  1. Running crontab -e to edit my cron
  2. Adding the line

    @reboot /home/stvn66/bin/remap_keys.sh
    

    to run the script remap_keys.sh containing one line:

    xmodmap /home/stvn66/bin/.xmodmap
    

None of these setting work to restore my custom settings on reboot.

0 Answers0