Special characters across all X apps

Written by  on December 9, 2015 

I finally got tired of keeping Emacs open to make special character entry easier in other applications. So, I set up my $HOME/.XCompose file like so:

include "%L"   # import the default Compose file for your locale
<Multi_key> <m> <E>        : "∃"   U2203 # THERE EXISTS
<Multi_key> <bar> <E>      : "∄"   U2204 # THERE DOES NOT EXIST
<Multi_key> <m> <e>        : "∈"   U2208 # element of
<Multi_key> <bar> <e>      : "∉"   U2209 # NOT AN ELEMENT OF
<Multi_key> <bar> <equal>  : "≢"   U2262   # _ ≠ NOT IDENTICAL TO
<Multi_key> <m> <^>        : "∩"   U2229   # intersection
<Multi_key> <m> <v>        : "∪"   U222a   # union
<Multi_key> <m> <R>        : "ℝ"   U211d   # reals
<Multi_key> <m> <C>        : "ℂ"   U2102   # complex
<Multi_key> <backslash> <A>   : "Α"   U0391    # GREEK CAPITAL LETTER ALPHA
<Multi_key> <backslash> <a>   : "α"   U03B1    # GREEK SMALL LETTER ALPHA

In order for it to work in Icedove and Firefox, you have to set the GTK_IM_MODULE environment variable for those (and other apps). I chose to place it in .xsessionrc so it would be there for all of them:

export GTK_IM_MODULE=xim

Category : System Admin


2 Responses

  1. gepr says:

    Forgot to mention I’m using Xfce and if your system-wide keyboard map isn’t set to have a default compose key, you have to go into Settings->Keyboard->Layout and choose your Compose key.

  2. gepr says:

    I just found out that GTK_IM_MODULE can affect whether or not the GPG-AGENT accepts pass phrases. A pass phrase typed on a machine with it set to “xim” will not be accepted on another machine. Maybe one day I’ll do a little more debugging and find out what’s actually happening.

Leave a Reply