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.


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
  • 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.

  • 1
    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
  • 1
    Works great for Ubuntu 16.04 using a Mac keyboard – Khai Dinh May 6 '16 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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