Remap caps lock to a control key
For keyboard shortcuts, sometimes it’s helpful to have Caps Lock act as a control key. Here’s how:
#!/bin/bash # from http://www.paganini.net/index.cgi/linux/nocaps.html
if [ $DISPLAY ] then # remap capslock to control xmodmap -e 'remove Lock' xmodmap -e 'keysym Caps_Lock = Control_L' xmodmap -e 'add Control = Control_L' fi
This is one of the most useful things I’ve ever learned, and it has made me more productive in my daily computer use.
UPDATE – 2010/07/22:
There’s an easier way to do this, if you’re using Ubuntu.
Fire up your handy Keyboard Shortcut settings, found under the
“System > Keyboard” preferences menu, as shown here:
Then, navigate to the “Layouts” tab and click on your current layout (mine is “USA”,) and click “Options.” Then, expand the “Ctrl key position” tree, and click “Make CapsLock an additional Ctrl” like this,
Upon clicking “Close” at the bottom right of that dialog, and again at the bottom right of the “Keyboard Preferences” dialog, you should be able to open and close browser tabs (Ctrl+T, Ctrl+W) and use text editor keyboard shortcuts to cut, copy and paste (Ctrl+X, Ctrl+C, Ctrl+V) without taking your hands off the home row, and you’ll be productive like a boss!
These screenies are from a Ubuntu system, but this SHOULD work on any X11 environment (Linux system) where Gnome is the Desktop Environment.
Windows users, there are ways to do this. I hope that you will look for them. However, I worked long and hard to get away from Microsoft products, so you will not find them here.
Enjoy!

