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