Monday, February 09, 2009

How to get the pipe symbol on a US keyboard?

Yesterday at FOSDEM 2009, I was asked in an interview done by linux-community.de's Nils Magnus, "how do you get the pipe symbol on keyboards without that extra key" (which "international" keyboards have, but US keyboards don't).
Apart from that question being off-topic, as the interview was supposed to be about my netbook talk I had held just before, it's funny that I knew the answer offhand, since I am very often in the situation to use a german keymap on a US keyboard. So here it is:

Copy this into your .Xmodmap:

! use altgr-# as pipe - if i have an US keyboard
! without key 86, i can use this as pipe.
keycode 51 = numbersign apostrophe bar bar bar bar


Then make sure that "Xmodmap ~/.Xmodmap" is run during login. I think this is done by /etc/X11/xinit/xinitrc.common, but don't quote me on that.

So now you have the pipe on "AltGr - #" (On a german keyboard. With the US keycaps it is "AltGr - |", which is not too inconvenient).
The "<" and ">" characters, which are also on this key (again, with a german layout), can be easily be typed by "AltGr - Shift - Y" for "<" and "AltGr - Shift - X" for ">".

Maybe this is helpful to somebody besides me.

Have fun ;)

No comments:

Post a Comment