For many years now, I have a custom xkb layout that swaps a few keys. At the startup of KDE, a script applies this custom layout: % cat xkb.sh #!/bin/sh xkbcomp -w 0 -R/usr/share/X11/xkb/ ${HOME}/etc/xkb/layout-${HOST_KEYBOARD} ${DISPLAY} Recently, this custom layout is regularly lost. It doesn't even seem to necessarily follow any particular event. For example this morning, I had to launch my script twice, once after my laptop came out of sleep and another time because the layout had been lost while I was working on it (but not after any particular event). I posted this bug on bugs.freedesktop.org at first (https://bugs.freedesktop.org/show_bug.cgi?id=93025) but was redirected here. Reproducible: Always Steps to Reproduce: 1. Setup a custom layout with xkbcomp 2. Wait a bit and do stuff 3. The custom layout was reset and replaced by the regular layout
I forgot to add in the bug description that my custom xkb layout is installed through an autostart script. I played a bit more with it and found that the script is executed but is quickly overridden when Plasma starts. Basically, I created a script that performs the xkb modification and also touches a file in my home. After logging into Plasma, the file is created in my home but the xkb modification is not effective. If I relaunch the script by itself, I get my custom xkb layout. My guess is that my custom layout run by the autostart script is quickly erased by a another layout configuration from Plasma.
>My guess is that my custom layout run by the autostart script is quickly erased by a another layout configuration from Plasma. Correct. A background daemon that makes the UI follow the user's settings. We can't simultaneously have tools that set keyboard layouts for users and sometimes not set the keyboard layout. You should be able to disable the keyboard layout daemon with system settings -> startup and shutdown -> background services -> keyboard.