How can I add a custom compose key sequence?
For example, I would like Compose, |, > to type the ▸
symbol.
I have tried adding the following to ~/.XCompose
:
# Import default rules from the system Compose file
include "%L"
# Custom definitions
<Multi_key> <bar> <greater> : "▸" U25B8 # Black right-pointing small triangle
but the new sequence is not usable anywhere except for xterm.
Installing ibus-table-compose and then enabling the Compose input method in IBus did not solve the problem; IBus imitated many compose key sequences, but not the one I had created.
Create a file named
.XCompose
in your home directory (~/.XCompose
), which contains:See
man 5 Compose
for more info about the format of this file.Add the following to
~/.profile
:On Ubuntu 18.04 (maybe others), you may need to use the following instead:
Log off and back on. Or restart X. Or reboot.
Create a file
~/.XCompose
(that is a file named.XCompose
in your "home" folder) which contains the following:See
man 5 Compose
for more info about the format of this file.On Ubuntu 14.04 I did the following:
1) Installed
uim
using the Software Manager, other packages likeuim-xim
,uim-gtk2
,uim-gtk3
anduim-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: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: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:
Many thanks to:
About custom compose key sequences:
About custom keyboard mapping:
Example
.Xcompose
files to mimicWindow US International
keyboards: