The config file for my compose key /usr/share/X11/locale/en_US.UTF-8/Compose lists all the key sequences for composing Greek letters; all of them require the pressure of a special dead_greek key. This is not a physical key of course, so, how can I assign an arbitrary key sequence to my compose key which produces this virtual dead_greek?

Also, I'd be interested to know if you have found a comfortable keyboard configuration regarding the compose key in general, and Greek letters in particular.

  • 1
    If your goal is to type polytonic greek, I think you're better off using ibus-m17n rather than the compose key. – chaskes Jun 15 '16 at 0:12
  • <dead_greek> is actually present in the "French (Bepo, ergonomic, Dvorak way)" keyboard layout. But have you tried to use any of the Greek keyboard layouts? – Gunnar Hjalmarsson Jun 15 '16 at 0:36
  • Note for others search for similar symbols, the Compose file can contain multiple definitions for a single character. For example, µ can be done with dead_greek, but it can also be done with compose key + u then /. – starbeamrainbowlabs Apr 20 at 21:24

To help anyone who stumbles here,

You need to configure ~/.XCompose (see full file below) and restart X session.

To type Greek letters on Latin keyboard:

  1. Hold compose key — usually it is right Alt (look for "Compose key location" in "Keyboard" sections in "System Settings"). <Multi_key> in the list below.
  2. Type g for small letters or G for CAPITAL letters. G stands for "Greek". Different capitalization for convenience
  3. Type the Latin alphabet equivalent.
  4. Release compose key.

You can see the list of compose sequences configured system-wide in file /usr/share/X11/locale/$LANG/Compose, where $LANG is environment variable for current locale (for US English, it is equal to en_US.UTF-8):

$ cd /usr/share/X11/locale/$LANG/
$ less Compose

To enable compose for Greek alphabet add to your ~/.XCompose file:

~/.XCompose
# GREEK CAPITAL LETTERS
<Multi_key> <G> <A> : "Α"    U0391    # GREEK CAPITAL LETTER ALPHA
<Multi_key> <G> <B> : "Β"    U0392    # GREEK CAPITAL LETTER BETA
<Multi_key> <G> <G> : "Γ"    U0393    # GREEK CAPITAL LETTER GAMMA
<Multi_key> <G> <D> : "Δ"    U0394    # GREEK CAPITAL LETTER DELTA
<Multi_key> <G> <E> : "Ε"    U0395    # GREEK CAPITAL LETTER EPSILON
<Multi_key> <G> <Z> : "Ζ"    U0396    # GREEK CAPITAL LETTER ZETA
<Multi_key> <G> <H> : "Η"    U0397    # GREEK CAPITAL LETTER ETA
<Multi_key> <G> <I> : "Ι"    U0399    # GREEK CAPITAL LETTER IOTA
<Multi_key> <G> <K> : "Κ"    U039A    # GREEK CAPITAL LETTER KAPPA
<Multi_key> <G> <L> : "Λ"    U039B    # GREEK CAPITAL LETTER LAMDA
<Multi_key> <G> <M> : "Μ"    U039C    # GREEK CAPITAL LETTER MU
<Multi_key> <G> <N> : "Ν"    U039D    # GREEK CAPITAL LETTER NU
<Multi_key> <G> <P> : "Π"    U03A0    # GREEK CAPITAL LETTER PI
<Multi_key> <G> <R> : "Ρ"    U03A1    # GREEK CAPITAL LETTER RHO
<Multi_key> <G> <S> : "Σ"    U03A3    # GREEK CAPITAL LETTER SIGMA
<Multi_key> <G> <T> : "Τ"    U03A4    # GREEK CAPITAL LETTER TAU
<Multi_key> <G> <U> : "Υ"    U03A5    # GREEK CAPITAL LETTER UPSILON
<Multi_key> <G> <F> : "Φ"    U03A6    # GREEK CAPITAL LETTER PHI
<Multi_key> <G> <X> : "Χ"    U03A7    # GREEK CAPITAL LETTER CHI
<Multi_key> <G> <O> : "Ω"    U03A9    # GREEK CAPITAL LETTER OMEGA

# DOUBLES (additional stroke <Q>)
<Multi_key> <G> <Q> <T> : "Θ"    U0398    # GREEK CAPITAL LETTER THETA
<Multi_key> <G> <Q> <O> : "Ο"    U039F    # GREEK CAPITAL LETTER OMICRON
<Multi_key> <G> <Q> <X> : "Ξ"    U039E    # GREEK CAPITAL LETTER XI
<Multi_key> <G> <Q> <P> : "Ψ"    U03A8    # GREEK CAPITAL LETTER PSI

# greek small letters
<Multi_key> <g> <a> : "α"    U03B1    # GREEK SMALL LETTER ALPHA
<Multi_key> <g> <b> : "β"    U03B2    # GREEK SMALL LETTER BETA
<Multi_key> <g> <g> : "γ"    U03B3    # GREEK SMALL LETTER GAMMA
<Multi_key> <g> <d> : "δ"    U03B4    # GREEK SMALL LETTER DELTA
<Multi_key> <g> <e> : "ε"    U03B5    # GREEK SMALL LETTER EPSILON
<Multi_key> <g> <z> : "ζ"    U03B6    # GREEK SMALL LETTER ZETA
<Multi_key> <g> <h> : "η"    U03B7    # GREEK SMALL LETTER ETA
<Multi_key> <g> <i> : "ι"    U03B9    # GREEK SMALL LETTER IOTA
<Multi_key> <g> <k> : "κ"    U03BA    # GREEK SMALL LETTER KAPPA
<Multi_key> <g> <l> : "λ"    U03BB    # GREEK SMALL LETTER LAMDA
<Multi_key> <g> <m> : "μ"    U03BC    # GREEK SMALL LETTER MU
<Multi_key> <g> <n> : "ν"    U03BD    # GREEK SMALL LETTER NU
<Multi_key> <g> <p> : "π"    U03C0    # GREEK SMALL LETTER PI
<Multi_key> <g> <r> : "ρ"    U03C1    # GREEK SMALL LETTER RHO
<Multi_key> <g> <s> : "σ"    U03C3    # GREEK SMALL LETTER SIGMA
<Multi_key> <g> <t> : "τ"    U03C4    # GREEK SMALL LETTER TAU
<Multi_key> <g> <u> : "υ"    U03C5    # GREEK SMALL LETTER UPSILON
<Multi_key> <g> <f> : "φ"    U03C6    # GREEK SMALL LETTER PHI
<Multi_key> <g> <x> : "χ"    U03C7    # GREEK SMALL LETTER CHI
<Multi_key> <g> <o> : "ω"    U03C9    # GREEK SMALL LETTER OMEGA

# doubles (additional stroke <q>)
<Multi_key> <g> <q> <t> : "θ"    U03B8    # GREEK SMALL LETTER THETA
<Multi_key> <g> <q> <o> : "ο"    U03BF    # GREEK SMALL LETTER OMICRON
<Multi_key> <g> <q> <p> : "ψ"    U03C8    # GREEK SMALL LETTER PSI
<Multi_key> <g> <q> <s> : "ς"    U03C2    # GREEK SMALL LETTER FINAL SIGMA
<Multi_key> <g> <q> <x> : "ξ"    U03BE    # GREEK SMALL LETTER XI

See also:

Most used letters can also be set up with separate compose key combinations. For example, π:

<Multi_key> <p> <i> : "π"    U03C0    # GREEK SMALL LETTER PI

You can also save this list in a file called GreekCompose and use include command in ~/.XCompose:

include "%L"
include "/path/to/GreekCompose"

The list above was created by manually adjusting output of small Python script: https://github.com/rybak/scripts/blob/master/extra/gen_x_compose.py

Do xmodmap -pke | grep dead_greek

If there's no output, you don't have a key representing dead_greek.

You can assign one. For example, I just assigned the right Alt key to dead_greek:

xmodmap -e 'keycode 108 = dead_greek Meta_R Alt_R Meta_R'

and now I can type ralt a ralt b ralt g and it comes out as αβγ.

  • I just tried that, works kinda cool. But if I keep AltGr pressed down, the keyboard generates a flood of µ. Also I lose the handy keystrokes for typing €, ĸilo, ¢ and the back-quote. – davide Sep 16 '16 at 11:45

Not a perfect solution, perhaps, but I used

xmodmap -e "keycode 191 = dead_greek dead_greek dead_greek dead_greek"

This mapped the F13 key on my keyboard to dead_greek (the four repeats are for different combinations of SHIFT and ALTGR with F13). The number 191 comes from looking at the output of xev | sed -ne '/^KeyPress/,/^$/p' when pressing F13 (it shows keycode 191).

  • I would have liked to map dead_greek to the SUPER_R key on my Apple keyboard, but this seems harder to do because Ubuntu grabs SUPER_R for the Unity menu, and SUPER_R and SUPER_L seem to be merged somewhere. More work needed to figure it out. – jdpipe Mar 4 '17 at 3:19
  • I like your clever method. Only thing is, I can't get my mapped dead_greek key to give me greek. my Compose file has dead_greek definitions, 'xmodmap -pke | grep dead_greek' gives me 'keycode 152 = dead_greek dead_greek dead_greek dead_greek' but when I tap the 152 key and then 'a,' I get 'a.' Can you point me in the right direction? – Geoffrey Wheeler Oct 31 '17 at 9:22
  • 1
    Try playing around with other keys instead, to see if that's your problem? – jdpipe Nov 3 '17 at 2:15
  • I tried [F9] and F[10] and they didn't work. I have to find a strategy to solve this problem. I tap the dead_greek key and then I tap 'a' That's how my Compose key works. Let me map dead_greek to that key and see what happens. – Geoffrey Wheeler Nov 3 '17 at 10:05
  • 1
    OK, I've mapped to to my Pause/Break key; it works in LibreOffice and my web browser. I was testing it in the terminal and Notepadqq and it doesn't work in those two places. I think there is probably an encoding in Notepadqq that it will work with. Thanks for your encouragement. – Geoffrey Wheeler Nov 3 '17 at 10:45

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.