How can one add custom Compose-key sequences? I have googled quite a bit, but could not find an explanation. In particular, I would like to have:

<Compose> + <Z> + <Z> = ℤ # Blackboard bold Z (set of integers)

In particular, I tried copying the file /usr/share/X11/locale/en_US.UTF-8/Compose to ~/.XCompose, and mimicked its syntax. However, this did not seem to work.

  • What did you do after creating ~/.XCompose to activate it? – l0b0 Dec 4 '13 at 13:07
  • well, nothing particular. The site I got this from didn't mention anything. What is one supposed to do? – jmc Dec 4 '13 at 13:13

See @Gilles' answer.

Original answer:

You may need to log out and in again, since your personal configuration files are read when logging in.

(There may also be some way to activate it without logging out and in again, but I'm not familiar with this specific configuration file.)

| improve this answer | |
  • 4
    No, you don't need to log out, only to restart the applications. The compose table is read by each application. For KDE, you may need to restart kdeinit, I haven't checked. – Gilles 'SO- stop being evil' Dec 5 '13 at 13:21
  • 1
    This is not an answer, at least without the actual actions required before logging out and in again. – naught101 Dec 24 '13 at 5:09
  • @naught101 The user has already performed those. The question was how to activate the new settings. – l0b0 Dec 24 '13 at 10:49

You're almost there: the file is indeed ~/.XCompose. You can specify an alternate location with the XCOMPOSEFILE environment variable. See the Compose manual page.

The missing piece of the puzzle is that the file is read by each application when it starts. The Compose key is not handled by the X11 server, but by the X11 library. In theory, an application could detect that the file has been modified or offer a command to reload it but I don't know of any that does. You'll have to restart your applications. Start a new editor or terminal emulator for testing.

| improve this answer | |
  • Thanks for your answer! I feel really stupid for not checking whether there was a compose manpage. However, Google did not turn it up either… – jmc Dec 5 '13 at 13:09
  • On Debian you can also have a look at the official wiki. – Immanuel Weihnachten Mar 30 at 10:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.