KDE system settings ignores .config/xkb settings

When I try to create a custom keyboard layout the files in the .config/xkb/symbols directory gets ignored by kde. (I’m not sure about other desktop environments).

Changing config files in the /usr/share/X11/xkb files works, but I want the .config method to work, because on immutable distros, like silverblue, modifying the /usr/ files is not possible.

Does anybody have a workaround for this problem?

edit: The error message in kde:

Keycodes above 256 (e.g. ) are not supported by X and are ignored
Error: Can’t find file “ushun” for symbols include
Exiting
Abandoning symbols file "(null)

I used ~/.xkb rather than ~/.config/xkb. (So still within my homedir, no need to touch anything else in the filesystem.)

As well as a file in ~/.xkb/symbols, I also needed to create ~/.xkb/evdev and ~/.xkb/rules/evdev.xml.

The only thing that doesn’t work is the preview of the layout in the KDE settings app - I believe that’s hardcoded to use the files in /usr/..... So while I can’t see a visual representation of the layout, I can switch to it and it does work as intended.

I think the same setup ought to work in ~/.config/xkb but I haven’t tried that.

I found this article very useful in understanding what I needed to do.

One more gotcha - you must have a newline at the end of your evdev. If you omit that than Plasma will crash on startup and you need to drop to a terminal and fix / rename / delete the file.

Note that the canonical documentation is at the xkbcommon website.