How to create lowercase pi (“π”) with compose key?
as others remark, there are no standard compose rules in X for π, so if you want to use compose to make the π symbol (as I just did), you could:
- install uim
- create
~/.XCompose
- put there the rules you need
- do not forget to start the file with
include "%L"
mine looks like this:
include "%L"
<Multi_key> <l> <l> : "ℓ" U2113 # litre symbol
<Multi_key> <p> <i> : "π" U03C0 # GREEK SMALL LETTER PI
this works on Debian. it does affect the way Ctrl-Shift-u works.
The X11 compose list is typically under /usr/share/X11/locale/
(this location may vary between distributions though), but the Compose
file is not necessarily in the directory named after your LC_CTYPE
setting. There is a stage of translation of locale names via the file /usr/share/X11/locale/compose.dir
. This translation allows many locales to share the same compose file. (Symbolic links would have been another way, but a text file is easier to distribute and works on platforms that don't have symbolic links — X11 exists outside of Unix.) Most locales that use the UTF-8 encoding for a language written in the Latin alphabet use the compose file for en_US.UTF-8
, located in en_US.UTF-8/Compose
.
In en_US.UTF-8/Compose
, the only way to generate U03C0
(GREEK SMALL LETTER PI) is <dead_greek> <p>
. There is no <Multi_key>
(Compose) sequence. Among the keyboard layouts distributed with X.org, the only one that defines a dead_greek
key is the BÉPO layout (a French analog of DVORAK). So there's no way to type π
using the Compose key with the default configuration. And the default UK layout doesn't include a way to type π
, not even in an XKB variant (a US Mac layout (us(mac)
) will give you π
on AltGr+P however).
As far as I can tell, there's never been a standard Compose sequence to insert π
on Xorg. If you remember one, you might have been an input method other than X11's built-in mechanism.
This isn't super convenient, but it works:
If you look in your Compose file for the 'pi' symbol:
% grep -i greek /usr/share/X11/locale/en_US.UTF-8/Compose | grep -i 'letter pi'
<dead_greek> <P> : "Π" U03A0 # GREEK CAPITAL LETTER PI
<dead_greek> <p> : "π" U03C0 # GREEK SMALL LETTER PI
You see that the combination for lowercase π is U03C0
So if you press ControlShiftu and then type in 03c0 Space, you are left with a π symbol.
The other way that should work is to define a key with xmodmap, but I have had problems with some applications not responding to that.