Monday, October 30, 2006

Ctrl -> CapsLock

I have to admit it, I'm also one of those freaks who moved their Ctrl key! You see, the problem is that I used to operate the left control key with my thumb. I could show you photos of this, but trust me, you don't want to see those... .

Usually, this is no problem at all (meaning I take only negligible physical damage), but every once in a while I have to type a lot (like finished my Ph.D. thesis), and then the situation just gets worse.

But there is a solution! Just move your control key up to the caps-lock key. This is cool for several reasons:

  • You can hit the (new) control key with your little finger - with even less strain than the original left control key.
  • On laptops, the control key is often moved to different positions, while the caps-lock key isn't.
  • It makes me think of the good ol' C=64:


    (Although for that, I would have to move the control key up to the tab key...)
  • You won't be able to use other computers any more.

The only question is, how to do it. Well, fortunately, it is rather simple:

  • Gnome/KDE: Just go to the keyboard preferences, setxkbmap options. There you can turn your caps-lock key into an additional
    control key.
  • Plain X (Xorg): setxkbmap -option "ctrl:nocaps". Also see here for more options.
  • Win XP: Open up regedit. Then add to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout a binary value named Scancode Map and set it to

    00 00 00 00
    00 00 00 00
    02 00 00 00
    1d 00 3a 00
    00 00 00 00

    Don't forget to reboot! Believe me, it's magic and it works!

Sunday, October 29, 2006

Shell Tool of the week: rlwrap

This week's "shell tool of the week" (and as such first of it's kind) is rlwrap. rlwrap calls another interactive program but channels all of the input through the readline library (the notorious piece of software which refuses to become L-GPL, for a reason), giving you extensive command-line editing capabilities even for programs which are just getting their input via gets (for example, ftp).

If it hadn't been done, I would've done it!

Addendum: I just found out that rlwrap actually stores different histories for each program it is used with!