Anton Karl Ingason

  • Increase font size
  • Default font size
  • Decrease font size

Customize Ubuntu keyboard (create "pipe" key)

Print
I recently lost my custom keyboard configuration in Ubuntu and had to reconfigure. I thought I should post this somewhere if anyone had the same problem. The problem with my Acer laptop keyboard is that there is no pipe key '|', which is bad for various reasons. To fix this I used xmodmap to remap AltGr+i to the pipe symbol.

The solution is the following:

Create your own Xmodmap:
xmodmap -pke > $HOME/.Xmodmap
... edit using a text editor:
gedit $HOME/.Xmodmap
In my case I wanted AltGr+i to produce the pipe, which is "bar" in xmodmap terminology, so I edited the line for keycode 31 as following:
keycode  31 = i I i I bar idotless
... and then you can reload the configuration:
xmodmap $HOME/.Xmodmap
I did this on Ubuntu 9.04, Jaunty, but it should work on other versions as well. You can of course use the same method to configure your keyboard to do just about anything you want.
Last Updated on Wednesday, 27 January 2010 16:13