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

After an hour or two of manpage and Google searching and finding no solution or good resources, I've come for help!

I have set my Caps Lock key to Ctrl using setxkbmap -option ctrl:nocaps - this works perfectly fine.

However, since I use [awesome][1], and an IBM model M which lacks the meta key, I need my left alt key to replace the windows key. Using xkeycaps I was able to get this to work, except it killed my arrow keys and End. Problematic.

Unfortunately, documentation on setxkbmap options are sparse. and I can't find the proper option to use.

Thanks for any links/solutions.

share|improve this question
up vote 9 down vote accepted

The list of predefined remapping options is in /usr/share/X11/xkb/rules/evdev.lst. In this case, you probably want one of

jinx:792 Z$ grep alt /usr/share/X11/xkb/rules/evdev.lst | grep win
  altwin               Alt/Win key behavior
  altwin:menu          Add the standard behavior to Menu key
  altwin:meta_alt      Alt and Meta are on Alt keys
  altwin:ctrl_win      Control is mapped to Win keys (and the usual Ctrl keys)
  altwin:ctrl_alt_win  Control is mapped to Alt keys, Alt is mapped to Win keys
  altwin:meta_win      Meta is mapped to Win keys
  altwin:left_meta_win Meta is mapped to Left Win
  altwin:hyper_win     Hyper is mapped to Win-keys
  altwin:alt_super_win Alt is mapped to Right Win, Super to Menu
  altwin:swap_lalt_lwin Left Alt is swapped with Left Win

The Windows key is generally mapped to X11's Super modifier, and the Menu key is sometimes mapped to its Hyper modifier.

share|improve this answer
perfect! setxkbmap -option altwin:swap_lalt_lwin was exactly what I was looking for! Thanks! – Wayne Werner Mar 10 '11 at 1:24
Is there a way to swap the right alt and win instead of the left? – Kerrick Dec 14 '11 at 21:05
As of today, swap_lalt_lwin doesn't work on my version of of setxkbmap, swap_alt_win did though. – Silas Paul Jun 5 '15 at 18:11
@SilasPaul if you had spent a few minutes then you could have found that setxkbmap -option "altwin:swap_alt_win" is the correct invocation. – Edgar Aroutiounian Nov 24 '15 at 18:28

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.