You are not logged in.

#1 2020-01-14 21:13:58

faetzminator
Member
Registered: 2007-09-18
Posts: 7

[Solved] Keyboard layout won't persist

Hi all

I'm running Fluxbox on X11 and having keyboard layout persistence issues for years, which I resolve by running (during login, or - worst case - manually):

$ setxkbmap -layout ch -variant de

I've been searching many times the possible ways how to "really" persist this value. No need to be user specific, may be system wide.
Simply said: no luck, whatever I've tried, it didn't persist.

The issue increased since I got one screen for multiple computers, including USB hub for my keyboard, a few weeks ago. Every time I switch back to Arch, I get wrong layout (en_US or similar).

While having the wrong keyboard layout right now, I can still see:

$ setxkbmap -print -verbose 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     ch
variant:    nodeadkeys
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete
symbols:    pc+ch(nodeadkeys)+inet(evdev)
geometry:   pc(pc105)
xkb_keymap {
        xkb_keycodes  { include "evdev+aliases(qwerty)" };
        xkb_types     { include "complete"      };
        xkb_compat    { include "complete"      };
        xkb_symbols   { include "pc+ch(nodeadkeys)+inet(evdev)" };
        xkb_geometry  { include "pc(pc105)"     };
};
$ cat /etc/X11/xorg.conf.d/00-keyboard.conf 
# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# instruct systemd-localed to update it.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "ch"
        Option "XkbModel" "pc105"
        Option "XkbVariant" "nodeadkeys"
EndSection
$ cat /etc/vconsole.conf 
KEYMAP=de_CH-latin1

I've looked through tons of pages, including...
https://wiki.archlinux.org/index.php/Xo … figuration
https://bbs.archlinux.org/viewtopic.php?id=218987
https://wiki.archlinux.de/title/Arch_Li … ch_stellen
https://bbs.archlinux.org/viewtopic.php?id=26530
http://fluxbox-wiki.org/Switch_Keyboard_layout.html
...

Any clue for a real fix or at least a workaround?

Cheers, faetzminator

Last edited by faetzminator (2020-01-15 20:39:54)

Offline

#2 2020-01-14 22:30:53

seth
Member
Registered: 2012-09-03
Posts: 50,012

Re: [Solved] Keyboard layout won't persist

Looking at /usr/share/X11/xkb/symbols/ch there're "de_nodeadkeys" and "fr_nodeadkeys" - but "nodeadkeys" doesn't seem to exist.
What you run to "fix" it would require

Option "XkbVariant" "de"

which however just includes the basic variant (ie. is equal to that)

Offline

#3 2020-01-14 22:48:50

Ropid
Member
Registered: 2015-03-09
Posts: 1,069

Re: [Solved] Keyboard layout won't persist

The way I understood things is:

You can check the names for available variants like this:

$ localectl list-x11-keymap-variants ch
de_mac
de_nodeadkeys
de_sundeadkeys
fr
fr_mac
fr_nodeadkeys
fr_sundeadkeys
legacy

That "localectl" tool can also be used to create a new config with this command line here:

localectl set-x11-keymap ch "" de_nodeadkeys

It will then write a new "00_keyboard.conf" file.

Offline

#4 2020-01-15 20:34:52

faetzminator
Member
Registered: 2007-09-18
Posts: 7

Re: [Solved] Keyboard layout won't persist

You are both right!
It was really the variant of the X11 config, and setxkbmap has temporary fixed it until it got reconnected.

Thanks to both!

Offline

Board footer

Powered by FluxBB