Annoying bug in KDE plasma with Greek keyboard layout

Hi,

My system’s locale is English US and the primary keyboard keymap is also English US (€ sign on 5 variant) but I use a secondary layout which is Greek Sun Type 6/7. The Greek keyboard appears in the plasma login screen as “English US” and since there is no flag icon to indicate the chosen layout, some times I get locked out of the system because I typed the wrong password (the annoying part). Also the layout indicator on the panel while it shows the correct flag for the Greek keyboard layout, when I hover the cursor over it the tooltip shows English US too.

I must note here that from the 6 in total Greek Layouts available only the Sun Type 6/7 has this problem but it is also the layout that matches exactly my keyboard.

The localectl in my case is set for X11 to US

System Locale: LANG=en_US.UTF-8
               LC_NUMERIC=el_GR.UTF-8
               LC_TIME=el_GR.UTF-8
               LC_MONETARY=el_GR.UTF-8
               LC_PAPER=el_GR.UTF-8
               LC_NAME=el_GR.UTF-8
               LC_ADDRESS=el_GR.UTF-8
               LC_TELEPHONE=el_GR.UTF-8
               LC_MEASUREMENT=el_GR.UTF-8
               LC_IDENTIFICATION=el_GR.UTF-8
    VC Keymap: us
   X11 Layout: us
  X11 Variant: euro

My distro is Manjaro testing with all the latest updates installed and the window subsystem is Wayland.

Any ideas ?

Thanks in advance

when the canned keyboard layouts do not suit you, then you can make your own that has exactly everything you want/need and nothing you don’t.

i did this recently and was writing up a tutorial/primer when i got pulled off to do other things the general steps are:

  • find a layout and variant that is close to what you need

  • copy that variant and make your changes to the character map

  • there is an .xml file you need to augment so that your variant shows up in the plasma GUI for keyboard layouts

  • select your custom layout in settings and enjoy.

Thanks for the suggestion however I have already the layout that suits my needs it’s this small bug that makes it kinda annoying. Would it be easier to fix it than creating a new layout ?

Do you by any chance know where these layouts are located? Maybe the label of this layout can be fixed in the XML file you mentioned. Just saying…

the layouts are in /usr/share/X11/xkb/symbols

i chose to modify the symbolic variant of the US layout, but you can work on any of them.

i would highly advise making a backup copy of the file before you go tinkering with it, just in case it becomes unusable.

from the layout directory
sudo cp us us-bak

i would also save a local copy of the section you intend to modify to your local directory as source document for your changes, then you can surgically cut and paste it in it’s entirety into the root file, rather than do open heart surgery on it while you work things out.

This was the section i worked on
// US Symbolic-Greek and Geek
// Author: droidgoo@proton.me
// based on us(symbolic) with many added symbols and improved organization
// while keeping the unique greek letters for science/engineering work
// paste this section at the end of /usr/share/X11/xkb/symbols/us
// the variant will be the text as shown in xkb_symbols "<variant>"
// GUI listings will show text defined in line name[Group1]= "English (US, Variant Desc Text)"


partial alphanumeric_keys modifier_keys
xkb_symbols "symbolic-geek" {

    include "us(symbolic)"
    name[Group1]= "English (US, Symbolic-Greek and Geek)";

    key <TLDE> { [ NoSymbol,   NoSymbol,    U2241,              approxeq            ] }; // ` ~ ≁ ≈
    key <AE01> { [ NoSymbol,   NoSymbol,    U220E,              because             ] }; // 1 ! ∎ ∵
    key <AE02> { [ NoSymbol,   NoSymbol,    twosuperior,        therefore           ] }; // 2 @ ² ∴
    key <AE03> { [ NoSymbol,   NoSymbol,    threesuperior,      numerosign          ] }; // 3 # ³ №
    key <AE04> { [ NoSymbol,   NoSymbol,    U25FE,              cent                ] }; // 4 $ ◾ ¢
    key <AE05> { [ NoSymbol,   NoSymbol,    dagger,             doubledagger        ] }; // 5 % † ‡
    key <AE06> { [ NoSymbol,   NoSymbol,    squareroot,         infinity            ] }; // 6 ^ √ ∞
    key <AE07> { [ NoSymbol,   NoSymbol,    section,            paragraph           ] }; // 7 & § ¶
    key <AE08> { [ NoSymbol,   NoSymbol,    multiply,           division            ] }; // 8 * × ÷
    key <AE09> { [ NoSymbol,   NoSymbol,    enfilledcircbullet, periodcentered      ] }; // 9 ( • ·
    key <AE10> { [ NoSymbol,   NoSymbol,    degree,             U2300               ] }; // 0 ) ° ⌀
    key <AE11> { [ NoSymbol,   NoSymbol,    emdash,             endash              ] }; // - _ — –
    key <AE12> { [ NoSymbol,   NoSymbol,    notequal,           plusminus           ] }; // = + ≠ ±

    key <AD01> { [ NoSymbol,   NoSymbol,    U21D1,              U21D3               ] }; // q Q ⇑ ⇓
    key <AD02> { [ NoSymbol,   NoSymbol,    U21D2,              U21D0               ] }; // w W ⇒ ⇐
    key <AD03> { [ NoSymbol,   NoSymbol,    Greek_epsilon,      U22EE               ] }; // e E ε ⋮
    key <AD05> { [ NoSymbol,   NoSymbol,    Greek_tau,          U156F               ] }; // t T τ ᕯ
    key <AD08> { [ NoSymbol,   NoSymbol,    Greek_iota,         U2051               ] }; // i I ι ⁑
    key <AD09> { [ NoSymbol,   NoSymbol,    Greek_omicron,      U204E               ] }; // o O ο ⁎
    key <AD11> { [ NoSymbol,   NoSymbol,    guillemetleft,      U2039               ] }; // [ { « ‹
    key <AD12> { [ NoSymbol,   NoSymbol,    guillemetright,     U203A               ] }; // ] } » ›
    key <BKSL> { [ NoSymbol,   NoSymbol,    U1F6C7,             brokenbar           ] }; // \ | 🛇 ¦

    key <AC01> { [ NoSymbol,   NoSymbol,    Greek_alpha,        U2659               ] }; // a A α ♙
    key <AC06> { [ NoSymbol,   NoSymbol,    Greek_eta,          U2656               ] }; // h H η ♖
    key <AC08> { [ NoSymbol,   NoSymbol,    Greek_kappa,        U2654               ] }; // k K κ ♔
    key <AC10> { [ NoSymbol,   NoSymbol,    uparrow,            downarrow           ] }; // ; : ↑ ↓

    key <AB01> { [ NoSymbol,   NoSymbol,    Greek_zeta,         U0277               ] }; // z Z ζ ɷ
    key <AB02> { [ NoSymbol,   NoSymbol,    Greek_chi,          UA66B               ] }; // x X χ ꙫ
    key <AB05> { [ NoSymbol,   NoSymbol,    Greek_beta,         U2657               ] }; // b B β ♗
    key <AB06> { [ NoSymbol,   NoSymbol,    Greek_nu,           U2658               ] }; // n N ν ♘
    key <AB07> { [ NoSymbol,   NoSymbol,    Greek_mu,           U2655               ] }; // m M μ ♕
    key <AB08> { [ NoSymbol,   NoSymbol,    lessthanequal,      U2303               ] }; // , < ≤ ⌃
    key <AB09> { [ NoSymbol,   NoSymbol,    greaterthanequal,   U2304               ] }; // . > ≥ ⌄
    key <AB10> { [ NoSymbol,   NoSymbol,    U262E,              U262D               ] }; // / ? ☮ ☭

    include "level3(ralt_switch)"
};


the keywords used in the layout definition (i.e. plusminus et.al.) can be found in a file called
keysymdef.h which you should be able to find somewhere on your system (mine was in a flatpak directory)… i just made a local copy so i could easily search it for the keywords i needed, or you can just use the UXXXX number as well.

both will work, and you can paste the actual character behind // comments for your reference… the codes are easy to find using kcharselect which you should have installed, but may need to run from a command line.

to get the layout to appear in the plasma settings GUI, you will also need to modify the .xml file

/usr/share/X11/xkb/rules/evdev.xml

which is also owned by root.

copy the format for the variant you are working on and change the details to match your new variant.

this is what i pasted into mine at the appropriate indenture
<?xml version="1.0"?>
<variant>
    <configItem>
        <name>symbolic-geek</name>
        <description>English (US, Symbolic-Greek and Geek)</description>
    </configItem>
</variant>

which results in it appearing in the GUI settings

also, i should mention that in order to access the 3rd and 4th charters on a keycap, you will need to assign a 3rd level shift key under the advanced tab…i used the Alt_R key for that and the Ctrl_R key for compose.

Thank you very much for this thorough and detailed tutorial.

I think it just became clear why the Greek Sun Type layout appears as English US. It’s because of the

include “sun_vndr/us(sun_type6)”

statement inside the symbol/keymap file which refers to English US layouts for the rest of the keymaps. The other GR layouts uses this statement but only to refer to other Greek Layouts.

Well the obvious (I think) solution to me is to use as a base one of the GR layouts that doesn’t refer to a US keymap in order to create my own custom layout and add from the Sun Type the missing keymaps only.

that sounds like a solid plan.

because, yes, these variants can be chained and built upon existing ones but you need to be sure of the foundation, otherwise it can get confusing.

if you want a purely GR based layout to switch to, then i would suggest doing your own layout (if you can’t find an existing one that suits) , but instead of using the US file as the source, use the GR file and modify that (don’t forget to make a back up copy).

that would also solve the flag issue.

for instance there is a EU variant of the US that brings in a bunch of EU centric characters, but because it is based on the US layout, it shows up as US in the system tray so it’s hard to tell which layout i’m using unless i hover over the system tray.

it’s nice when the US changes to EU or GR in the system tray for easy reference and that seems to be tied to which master layout from /usr/share/X11/xkb/symbols happens to be in use.

Yes I will take the appropriate backups and chose carefully the base keymap.

Thanks again for spending your time to resolve my issue.

I really appreciate it.