Mac Os keyboard layout in Ubuntu

Solution 1:

You can switch the alt and super keys using the keyboard configuration panel. I use xmodmap to switch the left keys and do a few more things. This setup appears to be more reliable over successive system updates. Here is my annotated .xmodmap:

! xmodmap for macbook keyboard.

! Vertical and horizontal mouse/touchpad scrolls like a touch screen.
! Note that 5 4 and 7 6 are reversed.
pointer = 1 2 3 5 4 7 6 8 9 10 11 12

! Switch left command and option (super and alt).
clear mod1
clear mod4
keycode 133 = Alt_L
keycode 64 = Super_L
add Mod1 = Alt_L
add mod4 = Super_L

! Right command and option are common keys that can be remapped
! using keyboard short cuts.
keycode 134 = Menu Break
keycode 108 = Pause Clear

! Map expose and dashboard to keys that can be remapped
! using keyboard short cuts.
keycode 128 = F15
keycode 212 = F16