Bug 501473 - Feature to change the keyboard layout to a specific user-specified one when switching to specific windows
Summary: Feature to change the keyboard layout to a specific user-specified one when s...
Status: CONFIRMED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_keyboard (show other bugs)
Version: 6.3.3
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2025-03-14 01:56 UTC by Damglador
Modified: 2025-03-21 17:00 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Damglador 2025-03-14 01:56:24 UTC
SUMMARY
I doubt anyone uses multilanguage passwords, and having to check your keyboard layout on every password prompt is annoying, so it would be nice to be able to set a particular layout as default for screen lock and the "enter your password" windows. This setting could be located in keyboard settings.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.3.3
KDE Frameworks Version: 6.11.0
Qt Version: 6.8.2
Kernel Version: 6.13.6-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Comment 1 Nate Graham 2025-03-14 15:45:43 UTC
> I doubt anyone uses multilanguage passwords

What do you mean?

What problem would this request be solving, if we implemented it?
Comment 2 Damglador 2025-03-14 21:06:15 UTC
I have Ukrainian and English keyboard layouts. Every time I'm on the lock screen or have polkit password window, I either have to stop and check if I'm on the right keyboard layout, and if I'm not - switch it. Or I just instinctively type my password and either waste a couple of seconds because I wasn't on English keyboard, or I'm on English keyboard and the gamble pays off.

Plus this links to https://github.com/sddm/sddm/issues/2042 (TLDR: You can type in password field even if you can't see it), which is an issue in both SDDM and Plasma lock screen (I forgot to report it for the lock screen), but In case of SDDM I can just start typing my password without having to see anything, because SDDM doesn't have multiple keyboard layouts, but that's not the case with Plasma lock screen. Plasma lock screen inherits keyboard layouts from session and doesn't show which one is chosen on the idle screen, and even if it did, it's the same issue as with polkit, I either check my keyboard layout every time, or just type my password and find out if the layout of correct.

The fact that polkit and lock screen have 5 seconds or so cooldown if you type a wrong password makes it even more annoying.

If I was able to set a default keyboard layout for polkit and lock screen I would be able to just skip these time-wasting checks and type my password, knowing that unless I type it wrong, there won't be an issue. 

It would be even better if this was also available in window rules. This is more of a niche use case, but as an example, Barony and Blender don't know how to work with Cyrillic keyboard layouts, so if I'm on Ukrainian, all key bindings are useless until I switch back to English (and if Barony uses Xwayland, which is the default behavior, I have to restart the game with the right keyboard layout). And since there's not much need for Ukrainian in Barony or Blender, I could just set it as default for these windows and not have to switch my keyboard layout back to English after I use the browser. Would it be better if apps solved their issues? Yes. But it's not always a realistic scenario

I hope my explanation is somewhat understandable.

This could work in 2 ways:
1. It locks polkit and lock screen, and other windows with this rule, to only using one keyboard layout, which is set by the user
2. When polkit and lock screen, and other windows with this rule, are open, they always use the specified keyboard layout, but user can switch it like they normally would, but this won't affect the global keyboard layout. So if I open polkit with English select, switch in polkit to Ukrainian and go to another window, keyboard layout will still be English.

The first one is somewhat unsafe because it could cause a softlock on the lock screen.
Comment 3 Damglador 2025-03-14 21:23:19 UTC
Window rule is just an idea to consider, the main scope is polkit and lock screen
Comment 4 Nate Graham 2025-03-17 19:51:16 UTC
It's understandable, thanks.

So basically, the issue is that you regularly use two keyboard layouts, and you set up your system password when using one of those layouts, and often forget which layout you had active when the screen locked?

Would it help if we made the keyboard layout appear much more prominently on the lock screen, in cases where the system is set up with more than one? I even vaguely recall an old patch to do this that didn't get merged for some reason.
Comment 5 Damglador 2025-03-17 21:32:35 UTC
> So basically, the issue is that you regularly use two keyboard layouts, and you set up your system password when using one of those layouts

Exactly.

> and often forget which layout you had active when the screen locked?

It's less about forgetting and more about spending time on this. Like even if keyboard layout was shown near the password field or somewhere in a visible place (which would still be a nice touch, like these "you have caps lock on" notices), but I would still have to check if it's the right layout and switch it if it's not, and for me that takes as much time as entering my password. But if it just automatically used English, I could just type my password in a second without worrying about my keyboard layout. 

I understand that it may not be an easy feature to implement, so it's fine even if it won't be implemented for year(s). But it definitely will be my next favorite feature, after remapping Caps Lock to switching keyboard layouts.
Comment 6 Nate Graham 2025-03-19 18:42:59 UTC
Thanks.

It seems like maybe what you're looking for is a more general way to automatically change the keyboard layout when switching to different UIs (lock screen, certain apps, etc). If it was a generic feature, perhaps the lock screen could be included there accidentally.

What do you think?
Comment 7 Damglador 2025-03-20 12:04:02 UTC
Yup, that would be awesome.