This because, I would like to override keys globally for both layouts at the same time. For example, change Control and Alt keys.
I have defined the following xkb file test4 and evdev.xml files that live in ~/.config/xkb/symbols and ~/.config/xkb/rules respectively. I am doing this, to escape the need to have scripts or other programs solving this problem. As I would like these files to be part of my dotfiles.
test4 contents:
default partial alphanumeric_keys modifier_keys
xkb_symbols "base" {
include "eu(basic)"
include "level3(ralt_switch)"
name[Group1]="EurKEY";
include "ru(winkeys)"
name[Group2]="Russian";
key <CAPS> {
[ ISO_Next_Group ]
};
};
gsettings set org.gnome.desktop.input-sources sources "[('xkb','test4')]"
Everything seems to load, however I notice the following issues:
after settings the sources using gsettings, the Russian layout is always selected by default instead of the EURKey layout.
the level3 (AltGr+key) symbols from EURKey Layout (e.g. ñ) are only available when Russian group is set. If I press again, I will not be able to access these keys. Not sure if this could be related to the fact that EURKey has defined 4 levels, while Russian layout only has 2.
I believe the solution is quite simple, I just do not see it. Any help to solve this is much appreciated.
But to find out the correct syntax would might be helpful to use the tools gnome offers.
Could you config as needed in gnome (maybe using gnome-tweaks)? If yes use the command to extract the entries you need: gsettings list-recursively org.gnome.desktop.input-sources to see the correct syntax and probably the position it needs to be.
However, I believe your recommendation will not work. Although gnome-tweaks provide some degree of customization, it does not provide the ability to define my own behavior for the key. Which I want to do in this case.
I believe you are missing the whole point. Gnome Tweaks only provides predefined options. I cannot customize them.
This is why I wanted to implement the customization using xkb and evdev.xml files.
Please, read my post once again.
You should use the interface to configure 2 layouts + your option, not altogether. But even so, you should already have everything you need in the advanced keyboard options by default, as @ilikelinux mentioned above. It’s just a matter selecting the relevant options. I see nothing in your setup that requires a custom config.