GNOME Bugzilla – Bug 696288
Custom keyboard layout doesn't work
Last modified: 2019-03-20 11:08:50 UTC
I have a custom keyboard layout (https://github.com/jistr/czenglish) and I'd like Gnome to use it. I set the dconf key org.gnome.desktop.input-sources.sources to "[('xkb', 'cen+nerd')]", which should be the Gnome 3.6 way to set a keyboard layout, but it doesn't work. If I add more layouts to the list, only the "stock" layouts get shown in the keyboard selection menu in panel, not my custom layout. Even if I don't use the variant and set it to just "[('xkb', 'cen')]", it still doesn't work. The keyboard layout is installed into the system correctly. Running `setxkbmap -layout cen -variant nerd` works well. (Previously, with Gnome 3.4, I used the layout by setting dconf key org.gnome.libgnomekbd.keyboard.layouts to "['cen\tnerd']" and it worked well.)
Rui, didn't we talk in Brno about adding a place for dropping custom layouts ? Mike wanted that too
Yes, we probably need to pick layout meta data from a directory where system administrators and packages can drop individual files into. The problem here is that we need a minimum of meta data for each layout: * short name - usually a 2 letter code like 'cs' to show in the top panel * description - a translatable name like 'Czech' and we get this from the xkeyboard-config rules xml file[1]. That's why just dropping the layout definition into /usr/share/X11/xkb/symbols isn't enough for it to show up in GNOME. [1] http://cgit.freedesktop.org/xkeyboard-config/tree/rules/base.xml.in
(In reply to comment #2) > Yes, we probably need to pick layout meta data from a directory where system > administrators and packages can drop individual files into. > > The problem here is that we need a minimum of meta data for each layout: > > * short name - usually a 2 letter code like 'cs' to show in the top panel > * description - a translatable name like 'Czech' > > and we get this from the xkeyboard-config rules xml file[1]. That's why just > dropping the layout definition into /usr/share/X11/xkb/symbols isn't enough for > it to show up in GNOME. > > [1] http://cgit.freedesktop.org/xkeyboard-config/tree/rules/base.xml.in Right. I thought we had discussed the possibility of picking up an extra rules file, e.g. from ~/.config/xkb/rules/extra.xml
I thought /usr/share/X11/xkb/rules/base.xml was meant to list all this information? Reading extra rules from the home directory would obviously be better, but I have amended the rules/base.xml file on my system and still don't get my custom layouts in the list.
Try editing /usr/share/X11/xkb/rules/evdev.xml
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/208.