Bug 509455

Summary: Enable keyboard layout preview when symbols file is not in '/usr/share/X11/xkb/symbols'
Product: [Applications] systemsettings Reporter: pg_tips <pg_forums>
Component: kcm_keyboardAssignee: Plasma Bugs List <plasma-bugs>
Status: CONFIRMED ---    
Severity: wishlist CC: butirsky, duha.bugs, kde, natalie_clarius, nate
Priority: NOR    
Version First Reported In: 6.4.4   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description pg_tips 2025-09-13 12:48:02 UTC
SUMMARY
When a custom keyboard layout is set up, and its symbols file is not located in '/usr/share/X11/xkb/symbols' but instead is in one of the other valid directories (see https://xkbcommon.org/doc/current/user-configuration.html#user-config-locations), no layout preview is available.

This is known behavior (the error message explicitly says "Previewing layouts that are defined outside your systems xkb directory is not supported and will also trigger this message."

However, it would be good to fix this and allow a preview when the symbols file is located in one of the other valid directories.

Particularly, users of "immutable" distros (such as KDE Linux) where /usr is read-only have no way of creating a custom keyboard layout that supports the preview functionality.


STEPS TO REPRODUCE
1. Create a custom keyboard layout whose files are stored under (for example) ~/.config/xkb/
2. In the Plasma System Settings app (Keyboard section), add the layout to the user's available layouts
3. Still in the System Settings app, click the three-dot menu at the right-hand side of the row for that layout, and select "Preview"

OBSERVED RESULT
In the preview window, no preview is shown, with a message "The keyboard geometry failed to load. [...] Previewing layouts that are defined outside your systems xkb directory is not supported and will also trigger this message"

EXPECTED RESULT
A valid preview should be shown.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 42
KDE Plasma Version: 6.4.4
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.1

ADDITIONAL INFORMATION
In tastenbrett's main.cpp, the 'findXkbRulesFile()' method seems to be hardcoded to examine only a single directory.