I have an Apple keyboard with a Swedish layout and this makes some characters very awkward to type, like right Alt key and 7 to type a left brace. Therefor I would like to reassign the right Command key to have the same function as the right Alt key. What is the correct way to achieve this with xkb?

My current solution is to load a modified dump from xkbcomp where I have swapped the keycodes for RWIN and RALT but this feels like a hack. Is anyone experienced with xkb?

1 Answer 1


This neat command solves the problem:

setxkbmap -option lv3:rwin_switch
  • @Sparhawk: OK, done. Easy to forget when you have to wait x hours before you are allowed to accept your own answer. Aug 7, 2013 at 14:02
  • Have some rep :)
    – Sparhawk
    Aug 7, 2013 at 22:40
  • What does the lv3 mean? I want to accomplish the same thing except switching the menu insteaf of the rwim. I replaced rwin_ with menu_ and now the menu key behaves as I want but not the left Alt(GR)
    – PuercoPop
    Aug 16, 2014 at 18:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .