On Ubuntu 14.04 I did the following:
1) Installed uim using the Software Manager, other packages like uim-xim, uim-gtk2, uim-gtk3 and uim-qt are auto installed. See https://launchpad.net/ubuntu/+source/uim.
2) Defined environmental variables by adding the next lines to ~/.profile, this way the custom compose key sequences only apply to the current user:
# Restart the X-server after making alterations using:
# $ sudo restart lightdm
# It seems only GTK_IM_MODULE or QT_IM_MODULE needs to be defined.
export GTK_IM_MODULE="uim"
export QT_IM_MODULE="uim"
The ~/.XCompose-file from the OP should work after restarting 1) Ubuntu or 2) just the X-server by runnung the following command in a terminal:
$ sudo restart lightdm
NB: Restarting only seems necessary after altering the ~/.profile file, alterations to ~/.XCompose will take effect the next time an application (Terminal, Gedit, etc.) starts.
To check whether the environmental variables are set right, enter the following command in your terminal:
$ printenv | grep IM_MODULE
Many thanks to:
About custom compose key sequences:
About custom keyboard mapping:
Example .Xcompose files to mimic Window US International keyboards: