SUMMARY startplasma-wayland sets the environment variables XKB_DEFAULT_MODEL, XKB_DEFAULT_LAYOUT, XKB_DEFAULT_VARIANT, and XKB_DEFAULT_OPTIONS with values supplied by systemd-localed, possibly overwriting values set by a particular user with system-wide default. STEPS TO REPRODUCE 1. export XKB_DEFAULT_LAYOUT=favorite_layout in .profile 2. launch plasma wayland session OBSERVED RESULT After session launch: $echo $XKB_DEFAULT_LAYOUT <system-wide default> EXPECTED RESULT $echo $XKB_DEFAULT_LAYOUT favorite_layout ADDITIONAL INFORMATION It is possible to set these variables in ~/.config/plasma-workspace/env instead as a workaroud, but it took me a lot of time to realize that!
Would you like to submit a merge request to fix it?
(In reply to Nate Graham from comment #1) > Would you like to submit a merge request to fix it? I suppose I could try, but (a) I am not sure what the right thing to do would be (just skip importing the values from systemd-localed when any of the XKB_* envvars is set?), and (b) I have zero experience with KDE development. Where should I start?
This is pretty much what you'd need to change: https://invent.kde.org/plasma/plasma-workspace/-/blob/master/startkde/startplasma-wayland.cpp#L47 Inside queryAndSet, you'd check to see if the value of `var` is already set using `qgetenv()`; if it is, skip the `qputenv()` function call.