keyboard settings will not stick

I’ve recently re-installed Leap 15.2 on my Acer Aspire laptop. Since the re-installation, or possibly since the most recent updates, every time I boot or log in the keyboard settings revert to what I guess is the US settings (e.g. shift-2 is @ and the @ key is ").

I have tried changing settings in Yast and in KDE system settings to GB settings. Each time the keyboard operates correctly as a GB keyboard for that session, but as soon as I either logout/login or reboot it reverts back to the ‘US’ settings. I’ve even tried playing around with localectl, but to no avail.

After a reboot or logout/login, the settings showing in Yast and KDE System Settings are as they were before logging out or rebooting, when they were working fine, but the keyboard is back to the ‘US’ settings. I’ve never, in many years use of OpenSuse, had this problem before. Before I re-installed Leap 15.2, the previous installation was working fine. I also have Manjaro KDE on my laptop and that is working fine. I’ve run out of ideas and for the time being will use Manjaro as it is driving me nuts keep having to remember to reinstate the keyboard settings in Leap. Any ideas, suggestions anyone?

is the settings file there ( i had an similar issue with some settings not sticking and the config file was not there) if it is there try using nano to edit it manually

Hi lag145. Which config file is it and where is it located?

do you want it to stick globally or only in your user account ?

the one you want to edit for globally is most likely /etc/sysconfig directly from the c: drive

Check this thread: https://forums.opensuse.org/showthread.php/547345-How-to-set-and-make-permanent-keyboard-layout-for-MacBook-Pros-both-in-TW-and-Leap-15-2

i’ve checked all the config settings that you both mention and all of them show GB keyboard settings. I cannot find any that have US keyboard settings.

I’ve done some more checks and this is what I’ve found:

If I add a second keyboard layout in System Settings > Keyboard, a Keyboard Layout icon appears in the task bar, which shows both alternative GB keyboard layouts. When I logout/login it then shows as US, although the alternatives list only shows the two GB layouts. Of course I can simply click on the icon and choose one of the gb layouts to switch the keyboard to GB.

If I logout and login as root, the keyboard is in US mode, so the behaviour is not user specific.

If I logout and type in the login entry box characters that are different in the US set from those in the GB set (e.g. " and @), it is clear that the keyboard is in GB mode.

If I login to the ICEWM desktop, again the keyboard has been switched to US, so it is not just associated with the Plasma settings.

If I login to the Plasma Wayland desktop, the keyboard remains in GB mode.

So, it must be an X11 setting that is enforcing the US keyboard settings on login when the desktop is using X11, even though the KDE System Settings are set to GB. So what have I missed??

Finally, just to restate, I have Manjaro KDE installed on the laptop and it doesn’t exhibit this behaviour. I also have Leap 15.2 installed on a desktop PC from the same ISO, just before I installed Leap 15.2 on the laptop, that also doesn’t exhibit this behaviour.

What are the results of *localectl* (either in a root shell or regular user) on both Manjaro and openSUSE?

  • In YaST – System Keyboard → English (GB).
  • In KDE System Settings – Hardware – Input Devices – Keyboard → either “Acer Laptop” or, “Generic 105 keys (International)”.
  • In KDE System Settings – Personal Information – Language – English (GB).
  • In KDE System Settings – Personal Information – Format – United Kingdom - English (GB).

Check with “localectl” that –

  • The System Locale is LANG=en_GB.UTF8

Use “localectl list-x11-keymap-variants gb” to list the available GB (West European Islands) keymaps.

  • Search the X11 configuration in /etc/ for “kblayout” – “ > grep -i ‘kblayout’ /etc/X11/xorg.conf.d/*” …

Only ‘00-keyboard.conf’ should have an entry –

       Option "XkbLayout" "gb"

Hi Nightstalker,

Here are the results of localectl status:

Manjaro:

System Locale: LANG=en_GB.UTF-8
VC Keymap: uk
X11 Layout: gb

Opensuse:

System Locale: LANG=en_GB.UTF-8
VC Keymap: uk
X11 Layout: gb
X11 Model: pc105
X11 Options: terminate:ctrl_alt_bksp

Which fits with the keyboard being in GB (UK) mode outside of X11.

Hi dcurtisfra,

  1. It is English (UK) - there is no English (GB) option.
  2. It is Generic 105 keys (International).
  3. It is British English (Default).
  4. It is United Kingdom - British English (en_GB)

X11-keymap-vaiants are:
colemak
dvorak
dvorakukp
extd
intl
mac
mac_intl

00-keyboard.conf’ has the following entry:

Section “InputClass”
Identifier “system-keyboard”
MatchIsKeyboard “on”
Option “XkbLayout” “gb”
Option “XkbModel” “pc105”
Option “XkbOptions” “terminate:ctrl_alt_bksp”
EndSection

As you can see there appears to be nothing wrong with these settings

Hello streakman,

Well, not exactly, this is good from a user’s X session :wink:

/etc/X11/xorg.conf.d/00-keyboard.conf is only read when you log in on an X session but before any X sessions, /etc/vconsole.conf serves to set keyboard’s layout (to make it persistent across reboots, regenerate as root the initramfs with ***dracut -f***).

What are the results of ***cat /etc/vconsole.conf***?

Hi Nightstalker,

You are right about my comment “Which fits with the keyboard being in GB (UK) mode outside of X11”. When I looked back at my post later, I realised what I had said - doh!

I’ve tried substituting the Manjaro vconsole.conf for the original Opensuse one, but it made no difference. The contents of the 2 files are:

OpenSuse:
FONT=eurlatgr.psfu
FONT_MAP=
FONT_UNIMAP=
KEYMAP=uk

Manjaro:
KEYMAP=uk
FONT=
FONT_MAP=

Currently the Manjaro one is being used.

In another internet search I came upon yet another paper that tells how to configure keyboards in X11 and it mentioned the command setxkbmap and running it with the -print option.
I am currently in US keyboard mode and setxkbmap gives:

nnn@xxx:~> 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: us
options: terminate:ctrl_alt_bksp
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+us+inet(evdev)+terminate(ctrl_alt_bksp)+terminate(ctrl_alt_bksp)
geometry: pc(pc105)
xkb_keymap {
xkb_keycodes { include “evdev+aliases(qwerty)” };
xkb_types { include “complete” };
xkb_compat { include “complete” };
xkb_symbols { include “pc+us+inet(evdev)+terminate(ctrl_alt_bksp)+terminate(ctrl_alt_bksp)” };
xkb_geometry { include “pc(pc105)” };
};

If I switch to GB extended keyboard, I get:

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: gb,gb
variant: extd,extd
options: terminate:ctrl_alt_bksp
Trying to build keymap using the following components:
keycodes: evdev+aliases(qwerty)
types: complete
compat: complete
symbols: pc+gb(extd)+gb(extd):2+inet(evdev)+terminate(ctrl_alt_bksp)+terminate(ctrl_alt_bksp)
geometry: pc(pc105)
xkb_keymap {
xkb_keycodes { include “evdev+aliases(qwerty)” };
xkb_types { include “complete” };
xkb_compat { include “complete” };
xkb_symbols { include “pc+gb(extd)+gb(extd):2+inet(evdev)+terminate(ctrl_alt_bksp)+terminate(ctrl_alt_bksp)” };
xkb_geometry { include “pc(pc105)” };
};

I’m not sure that this is doing anything other than confirming that in one instance I have the keyboard set to US and in the other to GB.

@streakman:

As suggested by Nightstalker, did you execute “dracut --force” ?

OK guys I am now sitting here with a **VERY Red Face!!:embarrassed:

**I have an icon on the task bar that is simply “EN”, which, when I hover over it says “EN IBus Panel”, so I assumed it was just another locale-type notification. Today I right-clicked it and looked at preferences and, what do you know, in the Input Method tab the entry was English (US)!! So, I deleted the entry and replaced it with English (UK, extended WinKeys) and my problem is solved.

So I am angry with myself for wasting so much time on this and even more, sorry to have wasted your time.

Your efforts at helping me are very much appreciated - you are a credit to the community.

No need to be angry – you’ve proved to us that, you’re a human being …

  • Only Robots are perfect – they write perfect, error-free, code – they never, ever, make mistakes …
  • Human beings produce errors … >:)

No worries :wink:
KDE and sddm should take the appropriate steps to call systemd-localed and set keyboard’s mapping globally (within X sessions and out of it) which is good as xfce/lightdm doesn’t do that and I needed to go through the localectl(1) path.