xmodmap for hacking keymaps is old hat; setxkbmap is the new hotness
I used to have a bunch of calls to xmodmap to do funky things like swapping the “alt” and “Windows” keys, setting caps lock to be another control key, and to set the right alt key (“Alt Gr”) as a Compose key ( see http://en.wikipedia.org/wiki/Compose_key ).
Instead now you can totally do all this with “setxkbmap” in one go, and no horrible .Xmodmap files to maintain (which are fiddly with the modifier keys such as control, and to remove the lockiness of caps lock) :D
The things I like to change on standard keyboards are all in the following command:
setxkbmap -model pc104 -layout us -option 'compose:ralt,ctrl:nocaps,altwin:swap_lalt_lwin'
..this set right alt as compose, sets caps to be an extra control key, and swap left alt and the left windows key.
Much nicer!
















