Bug 502585 - Keyboard layout set during installation doesn't appear in Keyboard KCM
Summary: Keyboard layout set during installation doesn't appear in Keyboard KCM
Status: CONFIRMED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keyboard (other bugs)
Version First Reported In: 6.3.4
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: accessibility, usability, wayland-only
: 498377 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-04-08 23:08 UTC by Fernando M. Muniz
Modified: 2025-08-14 16:38 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
cat ~/.config/kxkbrc (1.13 MB, image/png)
2025-08-12 23:20 UTC, Fernando M. Muniz
Details
All terminal commands. (109.44 KB, image/png)
2025-08-14 02:20 UTC, Fernando M. Muniz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fernando M. Muniz 2025-04-08 23:08:49 UTC
I've set a keyboard layout on all these distros to PT-BR (abnt2), with Arch being running on metal, and the rest on Boxes, and every time I look at Plasma's keyboard layout it's empty, meaning that it's set to EN-US. Pretty annoying if you're not in the US or UK.

Assuming the devs are in the US; You reproduce the issue by trying to install any of these distros with abnt2 keyboard layout, then post-installation you should notice that your keyboard is working fine, which shouldn't be the case.
Comment 1 Fernando M. Muniz 2025-04-09 02:05:58 UTC
I've installed Fedora Kinoite 41 on Boxes with the Japanese keyboard layout, and the keyboard layout didn't have the Japanese flag there.
Comment 2 Nate Graham 2025-04-09 19:35:08 UTC
So there are different distro-specific issues?
- On Arch, the keyboard layout you set in the installer doesn't appear in the KCM
- On Fedora Kinoite, the keyboard layout you set in the installer does appear in the KCM, but it's missing its flag

Do I have that right?
Comment 3 Fernando M. Muniz 2025-04-10 00:24:25 UTC
(In reply to Nate Graham from comment #2)
> So there are different distro-specific issues?
> - On Arch, the keyboard layout you set in the installer doesn't appear in
> the KCM
> - On Fedora Kinoite, the keyboard layout you set in the installer does
> appear in the KCM, but it's missing its flag
> 
> Do I have that right?

I didn't even knew I could see the keyboard layout without the country's flag being listed in "Layouts", how do I do that?

My issue is that no matter what distro I use, my country's flag is not appearing under the "Layouts" section of the Keyboard settings, even though I set it on the installer.
Comment 4 Nate Graham 2025-04-10 01:03:37 UTC
Can you please answer the question directly?
Comment 5 Fernando M. Muniz 2025-04-10 13:46:48 UTC
(In reply to Nate Graham from comment #2)
> So there are different distro-specific issues?
> - On Arch, the keyboard layout you set in the installer doesn't appear in
> the KCM
> - On Fedora Kinoite, the keyboard layout you set in the installer does
> appear in the KCM, but it's missing its flag
> 
> Do I have that right?

1- Yes. The keyboard layout I've set in the installer nor its flag appears under "Layouts".
2- No. The keyboard layout I've set in the installer nor its flag appears under "Layouts".
Comment 6 Nate Graham 2025-04-10 15:48:30 UTC
Thanks!
Comment 7 Kristen McWilliam 2025-04-11 17:53:33 UTC
Looks like layout chosen during install isn't listed in the KCM afterwards, regardless of installer/distro/language. Confirmed on my system (Fedora 41), Kinoite, and openSUSE Tumbleweed.

> Assuming the devs are in the US; You reproduce the issue by trying to install any of these distros with abnt2 keyboard layout, then post-installation you should notice that your keyboard is working fine, which shouldn't be the case.

I tried this by installing with language set to Japanese, and the keyboard layout does in fact seem to be Japanese afterwards, it just isn't listed.
Comment 9 Kristen McWilliam 2025-04-18 17:26:34 UTC
.. which is backed up by the fact that the bug isn't present in an x11 session.
Comment 10 Fernando M. Muniz 2025-05-20 23:33:48 UTC
*** Bug 498377 has been marked as a duplicate of this bug. ***
Comment 11 Fernando M. Muniz 2025-06-10 21:45:32 UTC
(In reply to Kristen McWilliam from comment #8)
> Seems like it might be x11 only:
> 
> https://invent.kde.org/plasma/plasma-desktop/-/blob/
> 139cc1c06454e31cc87fb3c3fa799f5591d98ab9/kcms/keyboard/kcm_keyboard.cpp#L50

Will this issue still affect distros that remove kwin-x11 once Plasma 6.4 releases?
Comment 12 Kristen McWilliam 2025-06-10 23:52:07 UTC
My previous comment was confusing; the bug is only present in Wayland sessions, so it affects anyone running Wayland. (which I presume is most people by now..)
Comment 13 Wismill 2025-08-12 10:05:14 UTC
Considering https://bugs.kde.org/show_bug.cgi?id=498377 is a duplicate, it might be an issue of the layout id mismatch between the installer and xkeyboard config. See my comment there: https://bugs.kde.org/show_bug.cgi?id=498377#c9.

@Fernando what is the content of ~/.config/kxkbrc after a fresh install with the issue?
Comment 14 Fernando M. Muniz 2025-08-12 11:29:35 UTC
I had to install with Boxes since I can't easily backup my files. It said "Invalid protocol"
Comment 15 Wismill 2025-08-12 11:52:38 UTC
(In reply to Fernando M. Muniz from comment #14)
> It said "Invalid protocol"
I meant the *content* of the file, but it seems you tried to execute it. Could you open it in Kate and paste the content here?
Comment 16 Fernando M. Muniz 2025-08-12 12:01:38 UTC
(In reply to Wismill from comment #15)
> (In reply to Fernando M. Muniz from comment #14)
> > It said "Invalid protocol"
> I meant the *content* of the file, but it seems you tried to execute it.
> Could you open it in Kate and paste the content here?

There wasn't a file. I entered this address with my already configured system and there was a file.

Should I test it with Fedora KDE too?
Comment 17 Wismill 2025-08-12 12:45:55 UTC
(In reply to Fernando M. Muniz from comment #16)
> (In reply to Wismill from comment #15)
> There wasn't a file. I entered this address with my already configured
> system and there was a file.

If the config file is empty, then KDE must be looking for the config somewhere else.

What about your environment variables $XKB_DEFAULT_LAYOUT and $XKB_DEFAULT_VARIANT? 

> Should I test it with Fedora KDE too?

It would be useful.
Comment 18 Fernando M. Muniz 2025-08-12 20:41:09 UTC
How do I get to these other two?

Fedora 42 KDE also showed "Invalid protocol".
Comment 19 Kristen McWilliam 2025-08-12 22:04:49 UTC
(In reply to Fernando M. Muniz from comment #14)
> I had to install with Boxes since I can't easily backup my files. It said
> "Invalid protocol"

What exactly is saying/giving that error? For example what is the output if in a terminal you do:

cat ~/.config/kxkbrc
Comment 20 Fernando M. Muniz 2025-08-12 23:20:50 UTC
Created attachment 184004 [details]
cat ~/.config/kxkbrc
Comment 21 Kristen McWilliam 2025-08-13 01:36:20 UTC
"No such file or directory" is as expected, but I can't imagine where "Invalid protocol" (as you initially mentioned) could come from.
Comment 22 Fernando M. Muniz 2025-08-13 01:38:31 UTC
(In reply to Kristen McWilliam from comment #21)
> "No such file or directory" is as expected, but I can't imagine where
> "Invalid protocol" (as you initially mentioned) could come from.

It was a message from Dolphin, the same type of message when you delete a folder while having Dolphin inside it.
Comment 23 Kristen McWilliam 2025-08-13 14:43:25 UTC
Ah, I understand now. Thank you for clarifying.

>> $XKB_DEFAULT_LAYOUT and $XKB_DEFAULT_VARIANT
> How do I get to these other two?

You can check these from the terminal as well:

echo $XKB_DEFAULT_LAYOUT

and..

echo $XKB_DEFAULT_VARIANT
Comment 24 Wismill 2025-08-13 14:57:09 UTC
Please copy also the output of the command:

    localectl status

in case the keyboard config is loaded directly from the locale.
Comment 25 Fernando M. Muniz 2025-08-14 02:20:25 UTC
Created attachment 184052 [details]
All terminal commands.

Seems that by default the system doesn't use the keyboard layout, even though it's clearly detecting it.
Comment 26 Wismill 2025-08-14 15:23:08 UTC
Then I do not know where the installer set the keyboard configuration, if it set it at all. @Nate Maybe some KDE dev can clarify what sources KDE uses to load the keyboard config if there is no `~/.config/kxkbrc` file?

@Fernando can you still add your keyboard layout *manually* in the KCM? Do not look for “ABNT2”, but simply “Brazil”, since it is the default layout for this country.
Comment 27 Fernando M. Muniz 2025-08-14 15:39:33 UTC
(In reply to Wismill from comment #26)
> Then I do not know where the installer set the keyboard configuration, if it
> set it at all. @Nate Maybe some KDE dev can clarify what sources KDE uses to
> load the keyboard config if there is no `~/.config/kxkbrc` file?
> 
> @Fernando can you still add your keyboard layout *manually* in the KCM? Do
> not look for “ABNT2”, but simply “Brazil”, since it is the default layout
> for this country.

I can do it manually, but what is the point of configuring the keyboard on Fedora? Is it intended to be only for the installer itself?(In reply to Kristen McWilliam from comment #8)
> Seems like it might be x11 only:
> 
> https://invent.kde.org/plasma/plasma-desktop/-/blob/
> 139cc1c06454e31cc87fb3c3fa799f5591d98ab9/kcms/keyboard/kcm_keyboard.cpp#L50

So this isn't the actual bug?
Comment 28 Wismill 2025-08-14 16:00:01 UTC
(In reply to Fernando M. Muniz from comment #27)
> (In reply to Wismill from comment #26)
> > @Fernando can you still add your keyboard layout *manually* in the KCM?
> 
> I can do it manually, but what is the point of configuring the keyboard on
> Fedora? Is it intended to be only for the installer itself?

The installer should configure the keyboard config in a way KDE Plasma can read it. I only ask if you can configure manually in order to discard any issue with the layout database and manual KCM setting and so that you can have a working keyboard while we deal with the current issue.

We are trying to determine if it is a KDE or a Fedora installer bug (or both?!). My take is that it is a Fedora installer bug (no layout or wrong layout set), but it is difficult to be sure without checking all the sources Plasma uses as keyboard config fallback.
Comment 29 Fernando M. Muniz 2025-08-14 16:29:49 UTC
Can the "VC Keymap" be the default on first boot when ~/.config/kxkbrc doesn't exist? It is showing the right layout in the attachment.
Comment 30 Wismill 2025-08-14 16:38:17 UTC
(In reply to Fernando M. Muniz from comment #29)
> Can the "VC Keymap" be the default on first boot when ~/.config/kxkbrc
> doesn't exist? It is showing the right layout in the attachment.

the `br-latin1-abnt2` is not a valid XKB layout. The XKB Brazilian ABNT2 is simply `br`.