https://bugs.kde.org/show_bug.cgi?id=503891

--- Comment #8 from Wismill <d...@wismill.eu> ---
- ~/.config/xkb/symbols/us replaces the *default* US layout, because 1) it has
the same file name 2) of the “default” in “default partial alphanumeric_keys
xkb_symbols "custom"”
- ~/.config/xkb/symbols/ua: same, but for the default Ukrainian layout

You do not see “English (Custom)” in the Plasma config because it loads the
info from /usr/share/X11/xkb/rules/evdev.xml, unless you provided a custom
~/.config/xkb/rules/evdev.xml. The entry in the system XML file has label
“English (US)”.

However, your config loads correctly: check that the layout switcher widget
displays e.g. “English (Custom)”, because the switcher uses the data from the
symbols files.

The “Custom” layout labelled as “A user-defined custom Layout” is yet another
feature and uses  /usr/share/X11/xkb/symbols/custom, that *is not shipped* by
xkeyboard-config. So if you did not created this file, it does not exist, and
selecting this entry will break your config! Note that this feature is a hack
aimed at X11 users. Under Wayland you should use the ~/.config/xkb files.

So in order to config your custom files and have them correctly labelled, you
need:
1. Replace your ~/.config/xkb/symbols/us file (same for the ua) with:

// Required to fix https://github.com/xkbcommon/libxkbcommon/issues/726, unless
using libxkbcommon 1.9+
default partial alphanumeric_keys xkb_symbols { include "us(basic)" };

partial alphanumeric_keys 
xkb_symbols "custom" {
    include "us(basic)"
    name[Group1]= "English (Custom)";
    key <AE01>  {[               1,          exclam,    onesuperior            
         ]};
    key <AE02>  {[               2,              at,    twosuperior,           
   U2019 ]};
    include "level3(ralt_switch)"  
};

2. Add a ~/.config/xkb/rules/evdev.xml file following these instructions:
https://xkbcommon.org/doc/current/user-configuration.html#discoverable-layouts
for both your layouts:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xkbConfigRegistry SYSTEM "xkb.dtd">
<xkbConfigRegistry version="1.1">
  <layoutList>
    <layout>
      <configItem>
        <name>us</name>
      </configItem>
      <variantList>
        <variant>
          <configItem>
            <name>custom</name>
            <shortDescription>us</shortDescription>
            <description>English (custom)</description>
          </configItem>
        </variant>
      </variantList>
    </layout>
    <layout>
      <configItem>
        <name>ua</name>
      </configItem>
      <variantList>
        <variant>
          <configItem>
            <name>custom</name>
            <shortDescription>ua</shortDescription>
            <description>Ukrainian (custom)</description>
          </configItem>
        </variant>
      </variantList>
    </layout>
  </layoutList>
</xkbConfigRegistry>


I added a link to the reference documentation of libxkbcommon in the KDE wiki.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to