Missing keyboard layouts in Linux/Gnome settings

I am using the US default keyboard on Manjaro Gnome (with wayland) but sometimes I need German special characters. I made my own version of the us file in the usr/share/X11/xkb/symbols folder that has the characters added. That works but always gets overwritten when there are updates.

I saw that there is e.g. a “German, Swedish and Finnish (US)” (de_se_fi) layout in the us file. So I thought I will try that one instead. However I cannot find any of the “German” variants of the US keyboard in the settings to select them.

I found that it is maybe missing in usr/share/X11/xkb/rules/base.lst, so I tried adding it:

These are the lines in usr/share/X11/xkb/symbols/us :

// German and Swedish characters added as third level symbols to the US keyboard layout
// Author: Stephan Lachnit <stephanlachnit@protonmail.com>, 2019
// the german umlauts are placed over the characters without diaeresis, the sharp-s over the s
// the swedish ao is placed over the p, since it's closed to the position on a swedish keyboard
// the euro sign is placed over the e, as it is usual for german and swedish keyboards
partial alphanumeric_keys
xkb_symbols "de_se_fi"  {

    include "us(basic)"
    include "eurosign(e)"
    name[Group1] = "German, Swedish and Finnish (US)";

    key <AC01> {[ a,            A,          adiaeresis, Adiaeresis ]};
    key <AC02> {[ s,            S,          ssharp,     U1E9E      ]};
    key <AD01> {[ q,            Q,          at                     ]};
    key <AD07> {[ u,            U,          udiaeresis, Udiaeresis ]};
    key <AD09> {[ o,            O,          odiaeresis, Odiaeresis ]};
    key <AD10> {[ p,            P,          aring,      Aring      ]};
    key <AD12> {[ bracketright, braceright, asciitilde             ]};

    include "level3(ralt_switch)"
};

I added this line to base.lst (under the ! variant section):

  de_se_fi        us: German, Swedish and Finnish (US)

I also tried creating my own layout usr/share/X11/xkb/symbols/cust_us_de:

default  partial alphanumeric_keys modifier_keys
xkb_symbols "basic" {

    name[Group1]= "Custom US/DE Keyboard Layout";

    include "us(basic)";
    include "eurosign(e)";

    key <AC01> {[ a,            A,          adiaeresis, Adiaeresis ]};
    key <AC02> {[ s,            S,          ssharp,     U1E9E      ]};
    key <AD07> {[ u,            U,          udiaeresis, Udiaeresis ]};
    key <AD09> {[ o,            O,          odiaeresis, Odiaeresis ]};
};

and adding this line to base.lst (under the ! layout section):

  cust_us_de      Custom US/DE Keyboard Layout

Both do not show up when I look for them in SettingsKeyboardInput Sources (also not after a restart)

Is there a way to test whether a layout file (e.g. usr/share/X11/xkb/symbols/cust_us_de) is working or causing an error? Or a way to see which layouts/variants in base.lst are actually loaded?

Do I need to reboot or whatnot to make the changes happen, after editing one of the above mentioned files? Or is it enough to close and open the settings dialog?


PS: I asked this already on stackoverflow, but since I got no reaction there and I still couldn’t figure this out myself, I thought I would try it here.

Hello,

And making it available in ~/.local/share/X11/xkb/symbols/ is not working better and also not being overwritten at updates?

I added both my modified us and my custom cust_us_de files to ~/.local/share/X11/xkb/symbols/, but I still have the default us [English (US)] layout in the settings and my custom one is not showing up at all. Also the de_se_fi [German, Swedish and Finnish (US)] is not showing, although it is in the us file

I found a way to change the keyboard layout for Gnome in the terminal:

gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us')]"

To set it to English (US)
(Gnome seems not to be aware of the change when using setxkbmap -layout us )

 gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us+euro')]"

changes it to English (US, euro on 5)

When I change lines within the usr/share/X11/xkb/symbols/us file, e.g.

key <AD09> {	[	  o,	O 		]	};

to

key <AD09> {	[	  o,	O,	odiaeresis, Odiaeresis ]	};

and then run gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us')]" , I am able to type the o umlaut with right Alt + O.

However, I tested changing the name of a Layout (or I guess variant) from English (US, euro on 5) to English (US, euro on 5 temp-test) and run gsettings set org.gnome.desktop.input-sources sources "[('xkb', 'us+euro')]", and that does not seem to have any effect.

I tried changing it in usr/share/X11/xkb/symbols/us and multiple files in the folder usr/share/X11/xkb/rules (base.lst, base.xml, evdev.lst, evdev.xml).

I do not understand where Linux/Gnome is getting the keyboard layout information form. It clearly uses usr/share/X11/xkb/symbols/us in some way, otherwise my “umlaut o test” would not have made a difference.
But where is the list of the available layouts and their names coming from?

It’s just hidden, with the standard setting in Gnome, so to make “German, Swedish and Finnish (US)” showing up in Gnome settings just go to:

Gnome Tweaks → Keyboard & Mouse and enable “Show Extended Input Sources”.

After restart (logout, login) of Gnome you could find it in the Keyboard layouts under “English (United States)” with the subentry “German, Swedish and Finnish (US)”.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.