Greek letters with compose in Ubuntu 16.04

I’m trying to write Greek letters on an Ubuntu 16.04 machine but I can’t get it to work.

I set the compose / multi_key to right alt (System settings > keyboard > shortcuts > typing > compose key)

I adjusted /usr/share/X11/locale/$LANG/Compose so that it holds the Greek alphabet like this:
<Multi_key> <g> <l> : "λ" U03BB # GREEK SMALL LETTER LAMDA

Now when I do ralt, g , l , I get nothing.

When I run xev and do ralt, g , l , it does find a lambda and xev returns XFilterEvent returns: False, anybody an idea how I could fix this?

Thanks,

ralt:

KeyPress event, serial 37, synthetic NO, window 0x4600001,
    root 0x177, subw 0x0, time 23214783, (928,209), root:(971,261),
    state 0x0, keycode 108 (keysym 0xff20, Multi_key), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: True

KeyRelease event, serial 37, synthetic NO, window 0x4600001,
    root 0x177, subw 0x0, time 23214838, (928,209), root:(971,261),
    state 0x0, keycode 108 (keysym 0xff20, Multi_key), same_screen YES,
    XLookupString gives 0 bytes: 
    XFilterEvent returns: False

g :

KeyPress event, serial 37, synthetic NO, window 0x4600001,
    root 0x177, subw 0x0, time 23216266, (928,209), root:(971,261),
    state 0x0, keycode 42 (keysym 0x67, g), same_screen YES,
    XLookupString gives 1 bytes: (67) "g"
    XmbLookupString gives 1 bytes: (67) "g"
    XFilterEvent returns: True

KeyRelease event, serial 37, synthetic NO, window 0x4600001,
    root 0x177, subw 0x0, time 23216341, (928,209), root:(971,261),
    state 0x0, keycode 42 (keysym 0x67, g), same_screen YES,
    XLookupString gives 1 bytes: (67) "g"
    XFilterEvent returns: False

l

KeyPress event, serial 37, synthetic NO, window 0x4600001,
    root 0x177, subw 0x0, time 23217550, (928,209), root:(971,261),
    state 0x0, keycode 46 (keysym 0x6c, l), same_screen YES,
    XLookupString gives 1 bytes: (6c) "l"
    XmbLookupString gives 1 bytes: (6c) "l"
    XFilterEvent returns: True

KeyPress event, serial 37, synthetic NO, window 0x4600001,
    root 0x177, subw 0x0, time 23217550, (928,209), root:(971,261),
    state 0x0, keycode 0 (keysym 0x10003bb, U03BB), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 2 bytes: (ce bb) "λ"
    XFilterEvent returns: False

KeyRelease event, serial 37, synthetic NO, window 0x4600001,
    root 0x177, subw 0x0, time 23217618, (928,209), root:(971,261),
    state 0x0, keycode 46 (keysym 0x6c, l), same_screen YES,
    XLookupString gives 1 bytes: (6c) "l"
    XFilterEvent returns: False

I ended up assigning the F7 key for <dead_greek>.

You can check if you have a <dead_greek> key installed by running xmodmap -pke | grep dead_greek. If no result, there is no key.

You can find the code for the desired <dead_greek> via xev | sed -ne '/^KeyPress/,/^$/p' and pressing the key. For me F7 is 73.

Then run xmodmap -e "keycode 73 = dead_greek dead_greek dead_greek dead_greek".
Unfortunately this goes away after log off, adding it to .bashrc requires you to start a terminal before it works. Adding it to /etc/profile doesn’t work for me.