You are not logged in.

#1 2020-01-07 11:39:35

mikpom
Member
Registered: 2020-01-06
Posts: 12

[Solved] Help with XKB configuration (can't set layouts properly)

Greetings Arch Linux fellows!

I having problems with custom configuration of keyboard layout and seeking for some help on this in my opinion rather complex topic.
I am using a very customized layout which I developed back then in Ubuntu 12-ish. Layout settings behavior has become quirky in Ubuntu 18 and it IS the main reason why I decided to try out Arch (it is supposed to be the most hackable). However I do not have much progress so far and describing it here.

I have custom symbols defined in a file where two layouts (US+RU) are defined.
Then I  run

xkbcomp -I/path/to/xkb/configuration my_map.xkb $DISPLAY 

File my_map.xkb in turn contains

xkb_keymap {
    xkb_keycodes  { include "evdev+aliases(qwerty)"    };
    xkb_types     { include "complete"    };
    xkb_compat    { include "complete+ledscroll(group_lock)"    };
    xkb_symbols   { include "pc+my(intl)+inet(evdev)+group(shifts_toggle)"    };
    xkb_geometry  { include "pc(pc104)"    };
};

so it adds this custom symbols (my(intl)) and specifies additional option to use shifts to toggle between the two layouts ("groups") in the symbols file.

However, when I run it in my latest Arch install I get the error and nothing happens to the layout.

Warning:          Unsupported high keycode 372 for name <I372> ignored
                  X11 cannot support keycodes above 255.
                  This warning only shows for the first high keycode.
Internal error:   Could not resolve keysym registeres
Internal error:   Could not resolve keysym registeres
Warning:          Key <OUTP> not found in evdev+aliases(qwerty) keycodes
                  Symbols ignored
Warning:          Key <KITG> not found in evdev+aliases(qwerty) keycodes
// some lines ommited for brevity //

I am not sure if the problem is in these configuration files and that these errors even matter (this setup works in Ubuntu, Debian). And overall I feel helpless to change layouts properly using xkb tools.
For instance, if I run

setxkbmap -layout us,gr

then it works in some applications (I can switch Greek/English in Emacs, Firefox) but in gnome terminal nothing happens like only a single US layout is present and layout switching is ignored.

To further complicate the issue there are "Region and Language" settings (available through system's GUI dialog) which currently list only US completely ignoring my setxkbmap call (which is expected). If I add additional layout using this menu then it is reflected in all application and works well. But of course this approach is not flexible and does not allow for custom layouts.

If I add let's say US+RU in "Region and Language" settings via GUI dialog and then run 

setxkbmap -layout us,gr

then weirdly I toggle between English and Russian in Gnome Terminal but between English and Greek in Firefox.
Can anyone explain what is going on ?

PS
To even further complicate the issue: while playing around withe the layouts I somehow augmented the layout set in login screen which now lists US(dvorak). I have absolutely no idea where was this configured.
Does the login screen have some other source of layouts?

Last edited by mikpom (2020-01-07 15:11:11)

Offline

#2 2020-01-07 13:02:39

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,133

Re: [Solved] Help with XKB configuration (can't set layouts properly)

it works in some applications (I can switch Greek/English in Emacs, Firefox) but in gnome terminal nothing happens

Are you by any chance running a wayland session?

loginctl session-status

Offline

#3 2020-01-07 13:14:19

mikpom
Member
Registered: 2020-01-06
Posts: 12

Re: [Solved] Help with XKB configuration (can't set layouts properly)

Yes it is GDM hence Wayland

Since: Tue 2020-01-07 19:39:23 +07; 33min ago
          Leader: 997 (gdm-session-wor)
            Seat: seat0; vc2
             TTY: tty2
         Service: gdm-password; type wayland; class user
           State: active
            Unit: session-2.scope
                  ├─ 997 gdm-session-worker [pam/gdm-password]
                  ├─1014 /usr/bin/gnome-keyring-daemon --daemonize --login
                  ├─1018 /usr/lib/gdm-wayland-session /usr/bin/gnome-session
                  └─1022 /usr/lib/gnome-session-binary

Offline

#4 2020-01-07 13:16:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,133

Re: [Solved] Help with XKB configuration (can't set layouts properly)

Think about it…

Offline

#5 2020-01-07 13:34:15

mikpom
Member
Registered: 2020-01-06
Posts: 12

Re: [Solved] Help with XKB configuration (can't set layouts properly)

I guess that for some applications (like Gnome-terminal) XKB settings are overridden by configuration in dconf which augments Gnome behavior. From this I conclude that dconf configuration is the way to go because it works in all apps (unless setxkbmap was invoked). However I do not understand how to use it flexibly because gnome-tweak-tool or dconf-editor do not allow for custom symbol tables (although for example, I could achieve swapping of Alt and Ctrl which is one of my custom configuration pieces).
It also makes XKB configuration pages not very useful and outdated. I have not seen anything about Wayland+XKB specifics and caveats.

PS. Login screen input can be separately configured via separate tab of "Region and Language" GUI.

Last edited by mikpom (2020-01-07 13:45:59)

Offline

#6 2020-01-07 13:46:37

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,133

Re: [Solved] Help with XKB configuration (can't set layouts properly)

setxkbmap talks to the X11 server (all the "x"es in your commands didn't ring a bell?) which in your case is the transitional Xwayland semi-emulator which also isn't used by all processes (but only X11 clients inside the wayland sesssion)
There's nothing outdated about this - that's like saying your photoshop tutorial is outdated because it doesn't work with gimp.

You'll have to configure the keyboard in gnome to affect any wayland application. For X11 clients you're better off using xorg configlets, https://wiki.archlinux.org/index.php/Xo … tion_files but I don't know to what extent gnome on wayland supports multiple layouts at all.

Alternatively you can run gnome on Xorg.

Offline

#7 2020-01-07 15:08:25

mikpom
Member
Registered: 2020-01-06
Posts: 12

Re: [Solved] Help with XKB configuration (can't set layouts properly)

Indeed switching to Gnome on Xorg makes configuration consistent, i.e. changes in Gnome conf affect all the applications as well as running xkbcomp also works for all applications.

Actually after that my initial configuration with

xkbcomp -I/path/to/xkb/configuration my_map.xkb $DISPLAY 

started to work regardless of warnings and errors which persisted.

Closed.

PS
Nevertheless solution through Gnome would be great to find (because it would be less hacky and Wayland-compatible). Unfortunately the options provided in Gnome-tweak-tool do not allow to, let's say map CapsLock+j as Down .

Offline

Board footer

Powered by FluxBB