December 31

meta key xmodmap ubuntu w/ a mac keyboard fix

I like using the apple Command key as both Alt and Meta in ubuntu. This makes switching windows feel the same as it does in OS X and makes the Command key act as the Meta key in Emacs.

The current “Layout Options” dialog in the Keyboard Preferences is a nice GUI to xmodmap, unfortunately, when you remap Alt to the Command key, Emacs picks it up as the Super key, which is a huge bummer.

All I had to do in the end is create a ~/.Xmodmap file and use this configuration:

! set the proper order for keys mapped to the apple command key
clear mod1
add mod1 = Meta_L Super_L Alt_L

All fixed!