Wednesday, February 16, 2011

Caps lock in Linux. Do you really need it?

I'm just stumped that we still have some archaic tech on our keyboards that we never ever seem to use, SysRq, ScrLk and of course, CAPS LOCK!

How many times has it happened that you accidentally hit the caps lock key and suddenly YOU HAVE TO RE-TYPE A COMPLETE SENTENCE because of this. Shift should be fine, right?

Hitting it by accident while gaming is also getting old fast!

Okay, end rant... here is what you need to do to disable it or map it to another key:

Code:
$ xmodmap -e "remove lock = Caps_Lock"

If you only want to disable it for the current session, or put this in your /etc/bash.bashrc to disable it permanently and system wide:

Code:
if [ "$PS1" ]; then
# Disables the CapsLock button
xmodmap -e "remove lock = Caps_Lock"
...
fi

But now you have a dead key, but fear not, you can map it to any action you would like, like for instance shit?

Code:
xmodmap -e "remove lock = Caps_Lock"
xmodmap -e "add shift = Caps_Lock"

Again, you can of course map it to any key you want, shift just seems logical to me.

There you go, no more HITTING THAT DARN KEY BY ACCIDENT!

No comments: