I really don't need caps lock (who does?) and would rather have it as a shift key as I sometimes hit it by mistake especially on the small netbook keyboard. Since I don't read while I type this might mean I have to retype half a page. I only find solutions for Ubuntu 12 but they don't work for 14 (Somehow the "typing" dialog looks totally different, not as user friendly). I've tried anyway and clicked on + to make a custom shortcut. It asked me for a name (I put Name: Caps clock) and for a command (command: disable, and I also tried command: shift), but that did nothing. It shows on right side under custom shortcut, but I still have caps lock. I am new at linux so please, if you have an answer don't just say: Use mxpt.de or so, but please tell me how to get to the dialog box or to a command prompt and what I need to do. (Somebody had a solution with Gnome Tweak or so, but I cannot find that program in Ubuntu 14). Thanks

up vote 30 down vote accepted

Opening a terminal and typing in:

xmodmap -e "keycode 66 = Shift_L NoSymbol Shift_L" 

followed by enter/return should remap the Caps Lock button the Left Shift.

However, this will need to be executed on each boot. You can do the following to automatically run this every time the system boots.

  1. Search "Startup Applications" in the dash and open it.

  2. Click add. For the name put "Caps Lock to Shift" and under "command" put xmodmap -e "keycode 66 = Shift_L NoSymbol Shift_L".

  3. Press save and restart. Enjoy!


If you would rather disable Caps Lock, you can execute the following (in terminal):

setxkbmap -option caps:none

Once again, this will reset once you restart, so add a startup entry (like above) to execute this on boot.

  • 2
    With this I got where I wanted to be. Than you. Great help including explaining how to get there. – Karsten Decker Jan 16 '15 at 14:46
  • No problem, @Karsten Decker! – Yharooer Jan 17 '15 at 0:01
  • 1
    I used the second one as the question is TL;DR and comes up first when you google how to disable caps lock. – RexFuzzle Jun 5 '16 at 6:06

You can remap Caps Lock is by using Gnome Tweak Tool.

You can install it via the Ubuntu Software Center if you wish or by the command line; it does not come installed on Ubuntu 14.04 by default.

  1. Open a terminal by holding CTRL, ALT and T at once or by search it in the dash.

  2. Type in sudo apt-get install gnome-tweak-tool. This tells apt-get to install gnome-tweak-tool. You need to have sudo as one needs to have root permissions to install software.

  3. Open Tweak Tool

  4. Select "Typing" from the left bar.

  5. Select "Caps Lock act as shift" where it says "Caps Lock key behaviour".

Screenshot depicting step 5 above.

  • 1
    Thank you both of you. I used method of Yharooer, and was able to disable Caps Lock which is good enough. (I could not read the end of the options like in your screen shot, so it was a bit guessing what additional... it would be). – Karsten Decker Jan 16 '15 at 14:32
  • I think it was additional shift key. Anyway, glad it helped! – Yharooer Jan 16 '15 at 14:36
  • 1
    works in 17.10! – jms Nov 12 '17 at 16:41

As for ubuntu 17.04 you can set a dconf setting:

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

No need to re-login.

  • Just to say the command below dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:none']" also works for ubuntu 16.04. Thanks to the poster. – ADW Apr 13 '17 at 12:49

There are many tools out there which can get the sort of thing you want. Probably the best one for you would be Gnome Tweak Tool. To install it, run this command in Terminal:

sudo apt-get install gnome-tweak-tool

Once it is installed:

  1. Open tweak-tool and click on the typing section in the left column.

  2. You should now see the line Caps Lock key behaviour on the left.

  3. Choose Disable from the drop-down list. And then it should disable the Caps Lock key.

  • Bums me out when when the first response/answer is the best answer but it doesn't get accepted and a copy of the first answer gets more votes. – Fred Hamilton May 5 '16 at 18:16
  • This answer might not technically be correct (or maybe have an alternate answer). On my system, Ubuntu 16.04, with Genome Tweak Tool, I had to choose the option Caps Lock is disabled rather than Disabled. The latter refers to disabling the Caps Lock key behavior in the tweak tool (I think), as mine was set to this option and the Caps Lock key still functioned as default. – nicorellius Jun 21 at 17:19
  • @nicorellius: This was the case on 15.04 when writing of the answer was done. – user364819 Jun 21 at 18:56
  • My bad, I was responding thinking it was for 16.04. Thank you. – nicorellius Jun 22 at 0:17
  • @nicorellius:Ok, that's fine. – user364819 Jun 22 at 4:49

To permantly disable CAPS-lock:

xkbset nullify lock

To re-enable it

xkbset nullify -lock.

To just toogle CAPS-lock:

sudo apt-get install xdotool
xdotool key Caps_Lock

for Ubuntu 17.10

sudo apt install -y gnome-tweak-tool
  1. Open Gnome Tweaks
  2. Select Keyboard & Mouse from the left panel
  3. Click on Additional Layout Options from the right side
  4. Click the arrow next to Caps Lock key behavior. Set Caps Lock key to what you want.

This one is to disable the caps lock permanently without restart:

setxkbmap -layout us -option caps:ctrl_modifier gsettings set

org.gnome.desktop.input-sources xkb-options "['caps:ctrl_modifier']"

The other answers show 2 excellent ways to disable the key with a command (xmodmap -e "keycode 66 = Shift_L NoSymbol Shift_L" and setxkbmap -option caps:none) but no great way to run this at startup.

From https://askubuntu.com/a/934797/282454 with some minor edits:

  1. Place your script into a system-wide directory such as /usr/local/bin with an appropriate shebang

    [Removed script example]

  2. Make it executable e.g. sudo chmod +x /usr/local/bin/disable-caps.sh

  3. Create a custom config file in /etc/lightdm/lightdm.conf.d. Use a name such as 99-disable-caps.conf. (The 99 prefix means that it will be run after the standard setup scripts provided in /usr/share/lightdm/lightdm.conf.d.)

    Add the location of your script as a display-setup-script in the [Seat:*] section: [Seat:*] display-setup-script = /usr/local/bin/disable-caps.sh

    The display-setup-script should be run after the X server is started, but before any greeter is run - see LightDM: Adding system hooks.

[Seat:*] is relatively new (Ubuntu 15.10 and later); use [SeatDefaults] on older systems.

I tested the following on 16.04

1. Install DCONF

sudo apt-get install dconf-tools

2. Disabling classic caps behaviour

The following disabled the caps key

setxkbmap -option "caps:none"

3. Configure option to re-enable it (optional)

If you still want to be able to re-enabled caps but only by pressing both shift keys (left and right) at once try the following

setxkbmap -option "shift:both_capslock"

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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