Skip to navigation

Setting up the compose key to type accented characters

October 4th, 2007

In /etc/X11/xorg.conf, in the keyboard section, I added the line:

Option   "XkbOptions" "compose:ralt"

Now, I can type most accented characters and umlauts by first hitting the right ALT key.

A few examples (key combinations below all preceded by right ALT key):

  • ` e: è (backtick followed by e)
  • " u: ü
  • , c: ç
  • s s: ß


Changed this to the Caps Lock key with:

Option   "XkbOptions" "compose:caps"

in xorg.conf

Addendum 2

In Jaunty (and maybe since Intrepid), this no longer works. The update manager comments out the entire keyboard section in xorg.conf, with the comment:

# commented out by update-manager, HAL is now used

A temporary solution is to open a terminal and execute the command:

setxkbmap -option compose:caps

You’ll have to repeat this on each login. You could put this in a shell script and add that to the commands that get executed on startup.

Addendum 3

In Xubuntu Jaunty, you can edit the file /etc/default/console-setup to contain the line:


to make this change permanent.

Thanks to foresto on the Ubuntu Forums!

Keyboard modification with ~/.Xmodmap

October 4th, 2007

In ~/.Xmodmap

keycode 233 = F20
keycode 234 = F19

After changes, say:

xmodmap ~/.Xmodmap

This activates the keys that I have on the IBM X40 next to the up arrow key on the bottom right of the keyboard. Now, I can bind them to commands Xfce.

Then, I found a nice article on using the CapsLock key to type German umlauts and other special characters.

Basically, just add the following, and you can use CapsLock+u to give ü, and so on for a handful of other characters.

keycode 66 = Mode_switch Multi_key
keycode 117 = Mode_switch Multi_key
keycode 39 = s S ssharp
keycode 38 = a A adiaeresis Adiaeresis
keycode 30 = u U udiaeresis Udiaeresis
keycode 32 = o O odiaeresis Odiaeresis
keycode 14 = 5 percent ssharp  degree
keycode 26 = e E egrave Egrave
keycode 28 = t T EuroSign EuroSign
keycode 27 = r R ecircumflex Ecircumflex
keycode 25 = w W eacute Eacute
keycode 31 = i I idiaeresis Idiaeresis
keycode 21 = equal plus plusminus notsign
keycode 57 = n N ntilde Ntilde
keycode 58 = m M Multi_key
keycode 15 = 6 asciicircum dead_acute  dead_circumflex
keycode 19 = 0 parenright degree masculine
keycode 10 = 1 exclam exclamdown onehalf
keycode 54 = c C ccedilla Ccedilla
keycode 24 = q Q copyright registered

To see all the assigned keycodes:

xmodmap -pke

Changing sensible (i.e. default) browser

October 4th, 2007

I want to use ~/firefox/firefox as my default browser. (I have an older version of Firefox installed system-wide, and 2.0 in my home dir). I think I set this somewhere in XFCE, and it works fine for most apps. However, some apps (e.g. xpdf) still use Konqueror — yikes (takes a long time to start up).

sudo update-alternatives --config x-www-browser

This gives me a list to pick from, and I can change to the system-wide Firefox or Opera, but ~/firefox/firefox is not in the list.

sudo rm /etc/alternativesx-www-browser
sudo ln -s /home/mpromber/firefox/firefox /etc/alternatives/x-www-browser

Links in xpdf didn’t open at all anymore, instead: Cannot execute /home/mpromber/firefox/x-www-browser-bin
update-alternatives --install /usr/bin/x-www-browser x-www-browser /home/mpromber/firefox/firefox 10

The last number is the “priority”, I have no clue what the value should be here. I tried 90, 10, and 1, and it didn’t make a difference as far as I could tell. In all three cases, ~/firefox/firefox is last in the list given by update-alternatives --config

Then …

sudo update-alternatives --config x-www-browser

… and pick the newly created ~/firefox/firefox entry.

However, trying to open links from xpdf again didn’t work (same error as above).

So then I just picked /usr/bin/firefox from the list in update-alternatives --config. Surprisingly, this works fine, opening a new tab in my running ~/firefox/firefox process (maybe it will open the wrong system-wide Firefox if I don’t have the right one running).

Local texmf for LaTeX packages in /home/

October 3rd, 2007

I told you this blog is my outsourced memory :)

I can put packages in my home directory at ~/texmf/tex/latex/, and into subdirectories of that dir. Then, say:


This will complain that it can’t update the system-wide texmf info, but no prob if no changes were made to that. So I moved sciposter.cls there instead of having to put it into every dir containing a poster I want to latex.

Some really good information about this, and alternatives.

Dia: exporting to eps with fonts that scale well

October 2nd, 2007

I use Dia to produce diagrams that I then include in LaTeX documents. I export them to .eps (encapsulated postscript) file format. If your diagram contains fonts and they look ugly (ragged) in the resulting LaTeX document, you picked the wrong export format. Make sure you pick “Encapsulated Postscript (using PostScript … fonts) (*eps)”. Or, from the commandline:

dia -e file.eps -t eps-builtin file.dia