I am afraid I know of no application that does this. Developing one would probably require creating your own input method (to replace XIM
).
However, I can offer you an alternative that you may find far more helpful than simply changing the key layout. X (through XIM
), for some time now, has offered a utility called XCompose. XCompose allows you to type “exotic” characters by hitting a leading key (which you designate) followed by customizable key sequences. For example, Composee' yields the character é
. The default sequences, for the most part, are quite intuitive, but the most powerful part of XCompose is that you can add (or modify) sequences in order to, theoretically, generate any unicode character you see fit.
The setup of sequences is done through plain text files (that you either put in $HOME/.XCompose
or that you put elsewhere but have $HOME/.XCompose
source (You can look at my whole setup here if you are interested; look specifically at XCompose
and the files under compose/
). Below is a snippet of my personal $HOME/.XCompose
:
include "%L" # This enables all the default bindings
include "/home/halosghost/.compose/greek.compose" # some greek characters
And now a snippet of the greek.compose
included above (beware that these are certainly not the most ergonomic or efficient sequences you could use, they are just an example):
# Lower case
<Multi_key> <a> <l> <p> <h> <a> : "α" U03B1 # Alpha
<Multi_key> <b> <e> <t> <a> : "β" U03B2 # Beta
<Multi_key> <d> <e> <l> <t> <a> : "δ" U03B4 # Delta
<Multi_key> <g> <a> <m> <m> <a> : "γ" U03B3 # Gamma
<Multi_key> <l> <a> <m> <b> <d> <a> : "λ" U03BB # Lambda
<Multi_key> <p> <i> : "π" U03C0 # Pi
<Multi_key> <m> <u> : "µ" U03BC # Mu
You an see that the format of these files is actually very simple (though there are a few cases where you do not use the character itself but rather a name for it (e.g., <period>
rather than <.>
)).
With the above, I can now type Capsmu to generate µ
(note that my Compose key is set to Caps).
You did not mention which distro you are using (or looking into using), but XCompose ships with xorg so all you should need to do is set it up. The related reading for setting Compose up with XIM
can be found here, but you should also note the XIM
is getting pretty old these days and it may not be the best option. Also, there is at least one other IME that supports Compose sequences (though it uses a slightly different implementation): IBus.
Personally, I use XIM
, and I hope to do so until I switch to wayland (where I hope there will be an all-around better IME waiting for me²), but this is Linux; one size doesn't fit all, and you should use what works best for your workflow (within reason).
From that link, you will find that you can easily set which key you use for Compose (assuming your keyboard is not esoteric enough to actually have a dedicated Compose key) through the following command (for Caps):
setxkbmap -option compose:caps
- I can dream, right?
As a fun final note, all “exotic” characters in this post (including é, “, ”, µ, ¹ and ²) were generated using XCompose.