Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[xkb] KDE Plasma (Wayland) does not support layouts in ~/.config/xkb #124

Open
fabi1cazenave opened this issue Feb 22, 2024 · 11 comments
Open
Labels
bug Something isn't working linux

Comments

@fabi1cazenave
Copy link
Collaborator

fabi1cazenave commented Feb 22, 2024

A possible workaround would be to set environment variables to select keyboard layouts explicitely :

# ~/.config/plasma-workspace/env/setkeymap.sh
export QT_LOGGING_RULES="kwin_*.debug=true"
export XKB_LOG_VERBOSITY=10
export KWIN_XKB_DEFAULT_KEYMAP=yes
export XKB_DEFAULT_LAYOUT=fr,us
export XKB_DEFAULT_VARIANT=ergol,altgr-intl
export XKB_DEFAULT_OPTIONS=# les options que tu veux
export XKB_CONTEXT_NO_SECURE_GETENV=yes

Related KDE bugs :

@fabi1cazenave fabi1cazenave changed the title [xkb] KDE Plasma (Wayland)does not sup [xkb] KDE Plasma (Wayland) does not support layouts in ~/.config/xkb Feb 22, 2024
@fabi1cazenave fabi1cazenave added the bug Something isn't working label Feb 22, 2024
@gagbo
Copy link
Contributor

gagbo commented Feb 22, 2024

It definitely works like that. The 2 main issues are:

  • you need to log out and log back in to change keyboard layouts, and
  • the graphical settings (ksettings5 or something) still won’t show the layouts in ~/.config/xkb, so you need to trust

@fabi1cazenave
Copy link
Collaborator Author

fabi1cazenave commented Feb 22, 2024

This means that :

I assume ksettings can see these layouts in /usr/share/X11/xkb/symbols ?

@fabi1cazenave
Copy link
Collaborator Author

TIL : KDE not supporting XKB layouts is not a bug, it’s a feature.

KWIN_XKB_DEFAULT_KEYMAP
This environment variable forces the xkb integration on Wayland to use a default keymap instead of using the configured one. Mostly required for testing. This environment variable is supported since 5.8.

https://community.kde.org/KWin/Environment_Variables#KWIN_XKB_DEFAULT_KEYMAP

@wismill
Copy link
Collaborator

wismill commented Feb 22, 2024

Mostly required for testing.

So the workaround above is confirmed to be a big hack.

@fabi1cazenave
Copy link
Collaborator Author

fabi1cazenave commented Feb 22, 2024

Seriously, KDE ?

  • the default keymap does support ~/.config/xkb on Wayland
  • our KDE magic does not
  • everything is fine, but let’s make an environment variable for testing

I really don’t get it. Why would a DE ever want to rely on its own magic rather than XKB for keyboard management ?

@wismill
Copy link
Collaborator

wismill commented Feb 22, 2024

The issue is that they have their own rules parser. So there are currently 2 workarounds:

  1. The hack above
  2. Editing directly ~/.config/kxkbrc. The GUI configuration then does display the right config, but becomes buggy if you change it. I do not see Kalamine modifying this file, but for me it’s a better workaround than the first one.

@fabi1cazenave
Copy link
Collaborator Author

If their parser supports /usr/share/X11/xkb/rules properly, I think we should just consider KDE as not compatible with ~/.config/xkb yet and make kalamine refuse to install layouts in user space when KDE is running — even if Wayland is detected.

So I guess we mostly have to inpect a KDE-specific environment variable and let kalamine decide accordingly ?

@fabi1cazenave
Copy link
Collaborator Author

I’m a bit worried though. Is it okay to consider that all Wayland desktop environments properly support ~/.config/xkb, and that KDE is just an exception ? Or should we take it the other way around, and only white-list DEs for which a proper ~/.config/xkb support has been confirmed ?

@wismill
Copy link
Collaborator

wismill commented Feb 22, 2024

No idea. I would say it depends if they use xkbcommon-registry. I would say yes for all DE designed for Wayland from the beginning. For the others… your mileage may vary!

@RichardFevrier
Copy link

Seems to be fixed for the next plasma release.

@cfergeau
Copy link

cfergeau commented Nov 4, 2024

I’m a bit worried though. Is it okay to consider that all Wayland desktop environments properly support ~/.config/xkb, and that KDE is just an exception ? Or should we take it the other way around, and only white-list DEs for which a proper ~/.config/xkb support has been confirmed ?

As a data point, GNOME supports ~/.config/xkb, I added these 3 files to get ergol support on f40/GNOME, and I got ergol entries in gnome control center as expected:

.config/xkb/rules/evdev
.config/xkb/rules/evdev.xml
.config/xkb/symbols/ergol

@trilowy trilowy added the linux label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linux
Projects
None yet
Development

No branches or pull requests

6 participants