This question already has an answer here:

I just installed Ubuntu 13.10 and miss the feature to swap the escape and Caps Lock key. It used to be possible through a GUI in Ubuntu 12.04. Anyone know how I can solve this?

Thanks for the help :)

marked as duplicate by waltinator, Eric Carvalho, v2r, Elder Geek, Evandro Silva Jan 9 '15 at 16:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

You can still directly access the underlying dconf key from the command line, as follows:

dconf read /org/gnome/desktop/input-sources/xkb-options
dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:escape']"

(It takes effect immediately.)

To enable multiple XKB options, list them as comma-separate quoted strings; for example, I also use Menu as my compose key:

dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:escape', 'compose:menu']"

See the xkeyboard-config manual page for a full reference of the XKB options you can use.

It used to be (in 13.04 and earlier) that you can create a file called .Xmodmap in your home directory and it will get setup automatically on login, but I haven't tested this in 13.10.

remove Lock = Caps_Lock
keysym Escape = Caps_Lock
keysym Caps_Lock = Escape
add Lock = Caps_Lock

Edit:

Now in 13.10 I've taken to editing swapescape in /usr/share/X11/xkb/symbols

partial hidden modifier_keys
xkb_symbols "swapescape" {
    key <CAPS> {        [       Tab, ISO_Left_Tab  ]       };
    key <ESC>  {        [     Caps_Lock    ]       };
    key <TAB>  {        [     Escape, Escape    ]       };
};

This allows me to use setxkbmap to use -variant basic on my programmable keyboard and -variant swapescape otherwise.

I made a work around (sort of) by putting the following commands in it and executing it everytime I reboot:

#! /bin/bash
xmodmap -e "clear Lock"
xmodmap -e "keycode 9 = Caps_Lock"
xmodmap -e "keycode 66 = Escape"
xmodmap -e "add Lock = Caps_Lock"

Unfortunately I also need to execute it every time I switch keyboard layouts, which I do way to often for this to be any solution I can use for long.

~/.Xmodmap is not automagically parsed by xmodmap at login time when using Unity in 13.10. You can create a wrapper script and have it run by "Startup Items" but every time you suspend/resume you'll find your capslock works as normal.

13.10 Unity has no way to disable/remap Caps_lock like kubuntu does. So far this is the only feature(bug? omission?) in Unity I've not found a way to work around or learn to live with.

CapsLock is dumb.

Not the answer you're looking for? Browse other questions tagged or ask your own question.