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 I can switch the left command key on the keyboard of my macbook, with the left ctrl key?

and if it is possible that the command right, continue acting like the super key / windows

share|improve this question
up vote 8 down vote accepted

Try this:

cat > ~/.xmodmaprc
! Erase existing bindings
clear Control
clear Mod4
! Map key 37 (left ctrl) to Super_L (i.e. 'cmd')
keycode  37 = Super_L
! Map key 133 (left cmd) to Control_L (i.e. 'ctrl)
keycode 133 = Control_L
! And update modifier settings
add control = Control_L
add mod4    = Super_L

To end the input, press Ctrl+D.

To test you can run:

xmodmap ~/.xmodmaprc

Finally, you should add this command to startup applications.

This should get you started. If this does not quite work for you, checkout this for more info:

man xmodmap

To watch which key press corresponds to which internal keycode, run


and press some keys when the little white window has the focus. The keycodes won't change (133 will always be 133, but you should see the name of 133 before as Control_L and after this procedure, after you log in again, it should be Super_L.

share|improve this answer
cheers, using a mac keyboard has never been so confusing until this swap. – Dimitar Christoff Sep 14 '12 at 13:10

A quick way to do this would be to goto System -> Preferences -> Keyboard -> Layouts tab -> Options -> Alt/Win key behavior -> select Win key as control


share|improve this answer
This option doesn't seem to exists in Unbuntu 13.10, did they remove it? – Håkon K. Olafsen Mar 8 '14 at 17:24

For anyone using KDE, check under System Settings > Input Devices > Keyboard > Advanced. You'll need to enable "Configure keyboard options", open up "Alt/Win key behavior", then check "Ctrl is mapped to Win keys (and the usual Ctrl keys)". There is an identical setting for Alt mapping to the Win keys if you'd prefer the Control key be Alt.

share|improve this answer

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.