Leap 15.4 KDE, always get english keyboard layout allthough german is configured

Hello,

I have a german hardware keyboard and my 15.4 installation is configured to use a german keyboard layout, which works fine when logging in into one of the ALT-F1…F9 consoles.

When logging via sddm and starting my default desktop which is KDE I have a problem since I always get an english keyboard layout. This is not good because right after login you are asked eg for the wallet password, firefox and thunderbird ask for their master password and typing passwords in a wrong keyboard layout is a very hard thing to do.

I configured my keyboard in KDE to be german and added a second english layout. This was the trick to see a language-flag showing the current layout and having a simple way to switch to the german layout right after the desktop comes up, but since 15.4 this flag simply does not appear right after login but only quite a while later.

my /etc/locale.conf is this:

cat /etc/locale.conf
LANG=de_DE.UTF-8



and my $HOME/[FONT=monospace].config/plasma-localerc is:


# cat[/FONT] [FONT=monospace][FONT=monospace][FONT=monospace].config/plasma-localerc[/FONT][/FONT][/FONT]
[FONT=monospace][FONT=monospace][FONT=monospace][FONT=monospace]LANG=de_DE.UTF-8 

[Formats] 
LANG=de_DE.UTF-8
[/FONT][/FONT][/FONT][/FONT]

Does anyone have an idea what I could try to get the configured german keyboard -layout upon login? Anyxone else having a similar problem?

Thanks
Rainer

Check settings:

[FONT=monospace]**Leap-15-4:~ #** localectl 
   System Locale: LANG=de_DE.UTF-8 
       VC Keymap: de-latin1-nodeadkeys 
      X11 Layout: de 
       X11 Model: pc105 
     X11 Variant: nodeadkeys 
     X11 Options: terminate:ctrl_alt_bksp 
**Leap-15-4:~ #** [/FONT]

Fix according to your needs.

[FONT=monospace]**** Operating System: openSUSE Leap 15.4
KDE Plasma Version: 5.24.4
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.14.21-150400.22-default (64-bit)
Graphics Platform: X11
Processors: 8 × Intel® Core™ i7-6700K CPU @ 4.00GHz
Memory: 31.0 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 530
[/FONT]

Thanks for your answer. When searching I also found your thread from a while ago describing a similar problem, so I also tried the solution, but it seems it does not work for me. Anyway, localctl shows this:

$ localectl
   System Locale: LANG=de_DE.UTF-8 
       VC Keymap: de-latin1-nodeadkeys 
      X11 Layout: de 
       X11 Model: pc105 
     X11 Variant: nodeadkeys 
     X11 Options: terminate:ctrl_alt_bksp

Since I wanted to find out if this is a KDE problem I selected Gnome at sddm level and in Gnome the keyboard layout was correctly in german as it should be. Then logout and login using KDE and then again the keybord had an english layout. So this problem seems to be related to KDE in some way.

The above is system locale. Check user locale in konsole:

karl@erlangen:~> echo $LANG 
de_DE.UTF-8 
karl@erlangen:~> echo $LANGUAGE 
de:en_US 
karl@erlangen:~> 

> echo $LANGUAGE
de:en_US

> echo $LANG
de_DE.UTF-8

I would say everything as expected isn’t it …? :\

Yep. What about KDE system settings? Added an english keyboard just for fun:

karl@erlangen:~> cat .config/kxkbrc  
$Version] 
update_info=kxkb_variants.upd:split-variants,kxkb.upd:remove-empty-lists,kxkb.upd:add-back-resetoptions 

[Layout] 
DisplayNames=, 
LayoutList=**de,us** 
LayoutLoopCount=-1 
Model=pc105 
Options=terminate:ctrl_alt_bksp,caps:none 
ResetOldOptions=true 
ShowFlag=false 
ShowLabel=true 
ShowLayoutIndicator=true 
ShowSingle=false 
SwitchMode=Global 
Use=true 
VariantList=nodeadkeys, 
karl@erlangen:~> 

I found a “new” workaround: Since bash is my default shell, I put


/usr/bin/setxkbmap de nodeadkeys

in my $HOME/.bash_profile which sets the keyboard layout to “german”. Its not a real solution, so if anyone has more ideas what I could try I will gladly try this in order to find the culprit…

Thanks
Rainer

Do you have by any chance some uncommented line in your ~/.profile ?

By default (at least here on 15.3) all lines concerning the languages are commented out:

# Sample .profile for SuSE Linux
# rewritten by Christian Steinruecken <cstein@suse.de>
#
# This file is read each time a login shell is started.
# All other interactive shells will only read .bashrc; this is particularly
# important for language settings, see below.

test -z "$PROFILEREAD" && . /etc/profile || true

# Most applications support several languages for their output.
# To make use of this feature, simply uncomment one of the lines below or
# add your own one (see /usr/share/locale/locale.alias for more codes)
# This overwrites the system default set in /etc/sysconfig/language
# in the variable RC_LANG.
#
#export LANG=de_DE.UTF-8    # uncomment this line for German output
#export LANG=fr_FR.UTF-8    # uncomment this line for French output
#export LANG=es_ES.UTF-8    # uncomment this line for Spanish output


# Some people don't like fortune. If you uncomment the following lines,
# you will have a fortune each time you log in ;-)

#if  -x /usr/bin/fortune ] ; then
#    echo
#    /usr/bin/fortune
#    echo
#fi

It may also be a good idea to check if there is any setting in ~/.bashrc as it says there:

# NOTE: It is recommended to make language settings in ~/.profile rather than
# here, since multilingual X sessions would not work properly if LANG is over-
# ridden in every subshell.

to be exact I do not have a ~myaccount/.profile file but only a ~/myaccount/.bash_profile and as said bash is my default shell. However there is nothing in there that touches the language:

myaccount@mydesktop:/home/myaccount> env|egrep “LANG|LC”
LANG=de_DE.UTF-8
LANGUAGE=de

If there was something wrong in my .bash* files this should also have an effect on Gnome. However in gnome I get a german keyboard just as expected. Only KDE makes somewhere, somehow a wrong descision for me …

Thanks
Rainer

I am reading this and am confused.

What I read from the title and the description is that there is a problem to get the correct keyboard layout configured (more special so that it survives logout).

IMHO this has nothing to do with language settings or locale. Language and the several locale settings are to influence output. When a program e.g. can give messages in several languages, the LANGUAGE environment variable can be interpreted to choose from the languages the program supports. Same for how to format date. currency, numbers (decimal dor or comma), etc.

This all has nothing to to with the keyboard that may be used for input. That configures which key (combinations) are to be interpreted as which character is ment to be typed.

These two things are complete independent.

Interesting point.

In KDE settings->keyboard the layout is always configured to be german, this does not change if after a fresh login the layout is actually “english”. The KDE settings dialogue still shows my configuration which is a “global”, “german” keyboard.

So the question is: why might KDE think it should configure an english layout on login instead?

Thanks
Rainer

But, but, but – everything that isn’t Bash, reads ‘~/.profile’ …

  • And, the KDE Plasma environment isn’t Bash …

I noticed that I still had a (german) keyboard layout defined in KDE system settings input-devices->keyboard. I removed it but this also did not change anything.

I also create another fresh user account (using yast). And this user also gets a english keyboard layout. Loging in into the linux consoles both users get a german keyboard layout, and as said before logging in using gnome also results in a german keyboard layout only KDE gives me a english one.

Really strange.

.profile does also not exist in my HOME-directotry.

Thanks
Rainer