You are not logged in.

#1 2022-02-26 17:04:19

bugbearcurious
Member
Registered: 2022-01-20
Posts: 6

Croatian/US keyboard layouts reset to broken config periodically

I have Croatian and US layout selected. I also do not like tilde, backtick and escape so I modified these keys by "caps:escape" option and .Xmodmap.

Ever since I did that the Croatian/US layout resets in a way that when I switch to Croatian all of the diacritics are missing (but for example, right alt key maintains the altgr behavior, in US layout it behaves the same as alt left key).

I have to run

setxkbmap -layout us,hr  && xmodmap ~/.Xmodmap

to get the layouts to work again with the modified tilde, backtick locations.

This then stays active for some time and then resets again in the same session. How would I figure out what's happening? I tried removing ~/.Xmodmap but it still continues to happen.

~/.xinitrc :

#!/bin/sh

userresources=$HOME/.Xresources  # does not exist
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources  # does not exist
sysmodmap=/etc/X11/xinit/.Xmodmap  # does not exist

# merge in defaults and keymaps

if [ -f $sysresources ]; then
    xrdb -merge $sysresources
fi

if [ -f $sysmodmap ]; then
    xmodmap $sysmodmap
fi
if [ -f "$userresources" ]; then
    xrdb -merge "$userresources"
fi
if [ -f "$usermodmap" ]; then
    setxkbmap -layout us,hr
    xmodmap "$usermodmap"
fi
exec startxfce4

.Xmodmap:

keycode  49 =
keycode  94 = grave asciitilde grave asciitilde notsign notsign
keycode  29 = y Y y Y z Z
keycode  52 = z Z z Z y Y

/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" "us,hr"
        Option "XkbOptions" "caps:escape"
EndSection

Last edited by bugbearcurious (2022-02-26 17:05:18)

Offline

#2 2022-02-26 21:05:58

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

Re: Croatian/US keyboard layouts reset to broken config periodically

Since there's no toggle configured, how do you switch the layouts?

Offline

#3 2022-02-27 16:24:16

bugbearcurious
Member
Registered: 2022-01-20
Posts: 6

Re: Croatian/US keyboard layouts reset to broken config periodically

seth wrote:

Since there's no toggle configured, how do you switch the layouts?

Through xfce4-keyboard-settings.

I went ahead and looked through keyboard-layout options and there was a XkbVariant ",us" string. I assume this selects the "Croatian (US)" variant. This might be the issue if this layout does not have diacritics at \';][

Last edited by bugbearcurious (2022-02-27 16:24:27)

Offline

#4 2022-02-27 17:54:00

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

Re: Croatian/US keyboard layouts reset to broken config periodically

/usr/share/X11/xkb/symbols/hr

xkb_symbols "us" {

    include "us"
    name[Group1]= "Croatian (US)";

    key <AD01> { [  any,  any,  backslash               ] };
    key <AD02> { [  any,  any,  bar                     ] };
    key <AD03> { [  any,  any,  EuroSign                ] };
    key <AD06> { [  any,  any,  z,           Z          ] };
    key <AD11> { [  any,  any,  scaron,      Scaron     ] };
    key <AD12> { [  any,  any,  dstroke,     Dstroke    ] };
    key <AC04> { [  any,  any,  bracketleft             ] };
    key <AC05> { [  any,  any,  bracketright            ] };
    key <AC08> { [  any,  any,  lstroke                 ] };
    key <AC09> { [  any,  any,  Lstroke                 ] };
    key <AC10> { [  any,  any,  ccaron,      Ccaron     ] };
    key <AC11> { [  any,  any,  cacute,      Cacute     ] };
    key <LSGT> { [  any,  any,  bar                     ] };
    key <AB01> { [  any,  any,  y,           Y          ] };
    key <AB04> { [  any,  any,  at                      ] };
    key <AB05> { [  any,  any,  braceleft               ] };
    key <AB06> { [  any,  any,  braceright              ] };
    key <AB07> { [  any,  any,  section                 ] };
    key <AB08> { [  any,  any,  semicolon               ] };
    key <AB09> { [  any,  any,  colon                   ] };
    key <AB10> { [  any,  any,  minus,       underscore ] };
    key <BKSL> { [  any,  any,  zcaron,      Zcaron     ] };

    include "level3(ralt_switch)"
};

The "basic" variant includes

xkb_symbols "latalpha" {

    key <AD11> { [ scaron,         Scaron        ] }; // [ {
    key <AD12> { [ dstroke,        Dstroke       ] }; // ] }

    key <AC10> { [ ccaron,         Ccaron        ] }; // ; :
    key <AC11> { [ cacute,         Cacute        ] }; // ' "
    key <BKSL> { [ zcaron,         Zcaron        ] }; // \ |
};

So the us variant seems to have upfancied glyphs on the same keys but behind the iso3 shift (altgr)

Compare

setxkbmap -print -query

in good and bad conditions.

Offline

Board footer

Powered by FluxBB