Checkmk 2.0 is here! See what's new.

Are you one of those people who are simply annoyed by the Caps-Lock key? Good news: As a Linux user you don’t need to use pliers to get rid of it. You can simply shut it down. I would like to briefly present one way to do this here. It works with all window managers and desktops (but not in Linux text mode).

Procedure

The Caps-Lock key always has the code 66 on PC keyboards (If you are curious how to find out something like this, just call the small program xev and press Caps-Lock).

With the xmodmap program, you can assign a new function to this key – or even none at all. To do this, enter the following command in a terminal window:

user@linux> xmodmap -e "keycode 66 ="

That’s it. Over and out. A check with xev proves that there is no longer a function assigned to the key (keysym 0x0, NoSymbol):

user@linux> xev
KeyPress event, serial 30, synthetic NO, window 0x3000001,
    root 0x5e, subw 0x0, time 9781197, (74,70), root:(1069,126),
    state 0x0, keycode 66 (keysym 0x0, NoSymbol), same_screen YES,
    XLookupString gives 0 bytes:
    XmbLookupString gives 0 bytes:
    XFilterEvent returns: False

Integration into the desktop

Fortunately, there is still one small thing missing: We have to make sure that this command is always executed automatically after logging in. Unfortunately this works differently on various desktops. With WindowMaker you can enter this command in ~/GNUstep/Library/WindowMaker/autostart. With Ubuntu/Gnome you create a file ~/.Xmodmap, which simply contains the line keycode 66 =. The next time you log in you will be asked if this keycode should be integrated.

If you are using KDE 4, create a text file (shell script) which contains only the above command, make it executable (chmod 755 file name) and put it in the directory ~/.kde4/Autostart/.

Linux knowledge

These articles were written by the founder of Checkmk many years ago.
They are still valid though and thus we keep them on our website.
Mathias has since then developed a monitoring software called Checkmk

Find out more