Can anyone explain how to swap Caps Lock and Ctrl keys on Ubuntu desktop under Unity. I use it to avoid emacs pinky.


The relevant option is no longer available in the settings menu in Ubuntu 13.10; this has been reported as a bug (https://bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/1218322). However, it is still possible to swap these keys using the Gnome tweak tool.

First, install gnome-tweak-tool using sudo apt-get install gnome-tweak-tool from a console.

Then, run it using the command gnome-tweak-tool, or by typing "Tweak Tool" into the dash at the top-left.

From this tool, choose the "Typing" tab on the left. Then, from the dropdown next to "Ctrl key position" on the right, choose "Swap Ctrl and Caps Lock". This should swap those two keys.

enter image description here

  • It was driving me nuts. Can't thank you enough. – user2239690 Jan 29 '14 at 15:34
  • Confirmed it worked for Ubuntu 18.04 and GNOME 3.28. – Culip May 17 at 3:39
setxkbmap -option ctrl:swapcaps

Will work on all linux distributions and versions. You will need to add it to your startup file to get it to run automatically when you log in.


go to System Settings/Keyboard Layout/(language)/options

  • there's no such option. I can reach as far as System Settings/Keyboard/Layout Settings, however there's no "options" to be found. – user2239690 Jan 29 '14 at 15:00
  • can you provide a screenshot where are you looking for it? Because there's an option to swap Caps Lock with Ctrl I just checked it myself. – JoKeR Jan 29 '14 at 15:06
  • @JohnyD. Which version of Ubuntu are you using? I'm looking in the same place (on 13.10) and the option doesn't seem to be there. I remember seeing something similar on an older version, for sure, but I think it may have been moved at some point. – Jez W Jan 29 '14 at 15:16
  • 1
    Yeah, it's a reported bug in 13.10 that this menu is missing. See bugs.launchpad.net/ubuntu/+source/gnome-settings-daemon/+bug/…. – Jez W Jan 29 '14 at 15:21
  • 1
    ![screenshot][1] [1]:s1.bild.me/bilder/260513/… – JoKeR Jan 29 '14 at 15:21

setxkbmap -option ctrl:swapcaps will only swap Control and CapsLock. If you want both keys to simulate Ctrl then gnome-tweak-tool -> "Typing" -> "Caps Lock as Ctrl". Now both keys work as Ctrl.

  • setxkbmap -option ctrl:nocaps will cause both keys to be control and is independent of gnome. – John Meacham Dec 30 '20 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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