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
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.
Search "Startup Applications" in the dash and open it.
Click add. For the name put "Caps Lock to Shift" and under "command" put
xmodmap -e "keycode 66 = Shift_L NoSymbol Shift_L".
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.
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.
Open a terminal by holding CTRL, ALT and T at once or by search it in the dash.
sudo apt-get install gnome-tweak-tool. This tells
gnome-tweak-tool. You need to have
sudoas one needs to have root permissions to install software.
Open Tweak Tool
Select "Typing" from the left bar.
Select "Caps Lock act as shift" where it says "Caps Lock key behaviour".
Update for version 3.32.0-1
The option is now under:
Keyboard & Mouse > Additional Layout Options > Caps Lock behaviour
More modern distros (ubuntu 20.04) now come installed with
gsettings instead of
gsettings set org.gnome.desktop.input-sources xkb-options "['caps:none']"
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.
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:
Open tweak-tool and click on the typing section in the left column.
You should now see the line Caps Lock key behaviour on the left.
Disablefrom the drop-down list. And then it should disable the Caps Lock key.
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:
Place your script into a system-wide directory such as /usr/local/bin with an appropriate shebang
[Removed script example]
Make it executable e.g. sudo chmod +x /usr/local/bin/disable-caps.sh
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:*] 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"
Here's my script that I use to enable/disable caps lock
$ cat ~/bin/caps #!/bin/bash let state=1 if [ $# -eq 0 ]; then xmodmap -pke | grep 'keycode\s\+66 = Caps_Lock' > /dev/null [ $? -eq 1 ] && let state=0 else [ "$1" == "on" -o "$1" == "1" ] && let state=0 fi if [ $state -eq 1 ]; then echo "Caps lock off" xmodmap -e "keycode 66 = VoidSymbol NoSymbol VoidSymbol" else echo "Caps lock on" xmodmap -e "keycode 66 = Caps_Lock NoSymbol Caps_Lock" fi