8

I recently discovered the compose key. It's wonderful to type Compose-> and get a Unicode right-arrow (→).

I know I can add my own, but where can I find a complete chart of the defaults?


The largest list I could find is this one at freedesktop.org. However, it seems imperfect too: For example, it lists a combination ComposeFU as producing "reversed hand with middle finger extended", which—quite disappointingly—doesn't work for me…

Is there somewhere these are stored on my actual live system?

Anko
  • 4,526

1 Answers1

11

You can find the compose table used by your system at the same place programs do: it's a text file. To locate it, you can run something like

strace xterm -e true 2>&1 | grep -i compose

For example, the relevant lines on Debian wheezy are:

open("/home/gilles/.XCompose", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/share/X11/locale/compose.dir", O_RDONLY) = 5
open("/usr/share/X11/locale/en_US.UTF-8/Compose", O_RDONLY) = 5

This demonstrates several things:

  • To define your own table, put it in the file ~/.XCompose. Actually, you can override this location by setting the environment variable XCOMPOSEFILE.
  • The location of the system table is listed in /usr/share/X11/locale/compose.dir. This file can list different tables for different locales.

ComposeFU is a recent addition, the corresponding character is itself a recent addition to Unicode.

  • Dang, I forgot strace existed. Great detective work. Thank you! – Anko Oct 30 '14 at 00:40
  • 1
    Just a note about using ~/.Xcompose. Unless you are copying a system Compose file into your ~/.XCompose file, make sure you put include "%L" at the top of it before your custom Compose lines. That way you can reference the locale specific system Compose file under /usr/share/X11/locale. This is slightly better in that you are always referencing the latest installed system Compose file for your locale and your custom Compose file is cleaner as it only contains your definitions. You can find out about %L by using man Compose from a terminal. – ConceptRat Oct 27 '20 at 00:41