Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I swap the left Alt and the left Super ("windows") keys in Saucy Salamander? I just upgraded and I have noticed the keyboard layout dialog has changed, and I can no longer find the options window. I use this option because occasionally I use a Sun keyboard that has super next to space, which I'm not used to.

share|improve this question
up vote 2 down vote accepted

You can use the following commands in terminal to swap Left Alt with Left Super:

xmodmap -e "keycode 64 = Super_L NoSymbol Super_L"    #this will make Alt_L to act as Super_L
xmodmap -e "keycode 133 = Alt_L Meta_L Alt_L Meta_L"  #this will make Super_L to act as Alt_L

To get this change for every session, after you have run the ​​previous commands create a file called .xmodmap with the new keymaps, using the following command:

xmodmap -pke > .xmodmap

Then, create a file called .xinitrc in your home directory, containing the following line/command:

xmodmap .xmodmap
share|improve this answer
Thank you for your answer! Unfortunately I don't find modifying the Xmodmap configuration every time I change keyboards (once or twice per day) very user friendly. – Joni Oct 23 '13 at 16:29
@Joni the change is permanent (for your user) if you create the .xinitrc file as he indicates – Braiam Oct 23 '13 at 16:33
@Braiam, depending on where I am I use the laptop keyboard or the Sun keyboard with the funny layout, which means having to swap or unswap the keys almost every time I start work. – Joni Oct 23 '13 at 17:11
I'm marking this answer as accepted because it's more general and may help future visitors better even if it's not the best solution in my particular case. – Joni Oct 24 '13 at 9:42

The layout options can be changed in gnome-tweak-tool, in the "Typing" section. The setting to configure "Alt/Win key behavior" is the last one in the list.

share|improve this answer
While your answer is correct and straight to the point, this it can't be generalized to any two keys. – Radu Rădeanu Oct 23 '13 at 16:16
the "Typing" section doesn't appear to even be in the gnome-tweak-tool an ymore... – chrismarx Mar 13 '14 at 18:11
Are you taking about the 14.04 beta @chrismarx? In 13.10 it's there. – Joni Mar 13 '14 at 22:20
Ah, I'm on 12.04, maybe that's the problem- – chrismarx Mar 14 '14 at 14:13
I believe in 12.04 this option was in the advanced settings in the main keyboard layout dialog. The advanced settings dialog was removed in 13.10, prompting this question. – Joni Mar 14 '14 at 16:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.