2

I want my Alt Gr key to act the same way as the Alt key. I've found a potential solution which is to open up terminal and run the following commands:

xmodmap -e "clear mod5"
xmodmap -e "keycode 108 = Alt_L"

This solution works but only temporarily. Whenever I restart the computer it reverts back or even if I'm using my laptop for a few hours the fix is undone.

I'm wondering if their is a permanent solution to this issue.

Just a little about me, I've only started using ubuntu in the last few months so I'm very inexperienced with it so I apologise in advance if I have follow up questions for any potential solutions.

Many thanks

Artur Meinild
  • 31,035
user207489
  • 53
  • 1
  • 5

1 Answers1

4

To get this change permanently for every session, create a file called .xmodmap with the the current keymap table, using the following command (after you have run previously xmodmap -e "clear mod5" and xmodmap -e "keycode 108 = Alt_L"):

xmodmap -pke > ~/.xmodmap

Then, create a file called .xinitrc in your home directory (using touch ~/.xinitrc command), containing the following line/command (use gedit ~/.xinitrc command to open the file for editing):

xmodmap .xmodmap

Another solution is to run:

sh -c 'xmodmap -e "clear mod5"; xmodmap -e "keycode 108 = Alt_L"'

command to your startup applications and that'll run it when you log in. Search in Dash for "startup applications".

Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407