重新启动后未检测到新的键盘布局变体

重新启动后未检测到新的键盘布局变体

我已在文件中添加了一个新部分/usr/share/X11/xkb/symbols/il。然后我添加了该部分的引用/usr/share/X11/xkb/rules/base.lst并刷新了sudo dpkg-reconfigure xkb-data。但是,即使重新启动系统(Kubuntu 20.04 LTS)后,新的键盘布局在 KDE 的系统设置中也不可用。

以下是系统的摘要以及我所做的更改:

$ # Running the current Ubuntu LTS
$ cat /etc/issue
Ubuntu 20.04.3 LTS \n \l

$ # Kernel up to date
$ uname -a
Linux matrix-lenovo 5.11.0-38-generic #42~20.04.1-Ubuntu SMP Tue Sep 28 20:41:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

$ # Using X11, not Wayland
$ loginctl show-session $(loginctl|grep $(whoami) |awk '{print $1}') -p Type
Type=x11

$ # Emptied XKB cache
$ ls -la /var/lib/xkb
total 12
drwxr-xr-x  2 root root 4096 Oct 27 12:31 .
drwxr-xr-x 89 root root 4096 Oct 26 08:19 ..
-rw-r--r--  1 root root  644 Jul  6 13:17 README.compiled

$ # Added "Potsatzi" Hebrew layout to XKB rules
$ grep Hebrew /usr/share/X11/xkb/rules/base.lst
  il              Hebrew
  lyx             il: Hebrew (lyx)
  phonetic        il: Hebrew (phonetic)
  biblical        il: Hebrew (Biblical, Tiro)
  potsatzi        il: Hebrew (Potsatzi)

$ # Added "Potsatzi" Hebrew layout to Hebrew XKB symbols file
$ diff /usr/share/X11/xkb/symbols/il.bak /usr/share/X11/xkb/symbols/il
140a141,205
> // Based on lyx, with additional useful directional characters
> // See table here: https://dotancohen.com/howto/rtl_right_to_left.html
> partial alphanumeric_keys
> xkb_symbols "potsatzi" {
>     name[Group1]= "Hebrew (Potsatzi)";
> 
>     key <TLDE> { [ semicolon, asciitilde      ] };
>     // On some key (e.g. AD01, right below) there is not yet mapping for the
>     // second shift level. Since I could not figure a simple way to map this
>     // to "emit nothing", it is currently mapped to the same letter of the
>     // first shift level (avoiding mapping may risk it be used by a character
>     // from a different group).
>     key <AD01> { [ slash, slash                       ] };
>     key <AD02> { [ apostrophe, apostrophe     ] };
>     key <AD03> { [ hebrew_qoph, 0x10005b8     ] }; // Qamats
>     key <AD04> { [ hebrew_resh, 0x10005bc     ] }; // Dagesh/Shuruq
>     key <AD05> { [ hebrew_aleph, 0x100200e    ] }; // LRM
>     key <AD06> { [ hebrew_tet, 0x100200f      ] }; // RLM
>     key <AD07> { [ hebrew_waw, 0x10005b9      ] }; // Holam
>     key <AD08> { [ hebrew_finalnun, 0x100202a ] }; // ADDED by potsatzi LRE
>     key <AD09> { [ hebrew_finalmem, 0x100202b ] }; // ADDED by potsatzi RLE
>     key <AD10> { [ hebrew_pe, 0x10005b7               ] }; // Patah
> 
>     key <AC01> { [ hebrew_shin, 0x10005b0     ] }; // Sheva
>     key <AC02> { [ hebrew_dalet, 0x10005bc    ] }; // Dagesh/Shuruq
>     key <AC03> { [ hebrew_gimel, hebrew_gimel ] };
>     key <AC04> { [ hebrew_kaph, hebrew_kaph   ] };
>     key <AC05> { [ hebrew_ayin, 0x10005c2     ] }; // Sin dot
>     key <AC06> { [ hebrew_yod, 0x10005c1      ] }; // Shin dot
>     key <AC07> { [ hebrew_chet, 0x10005b4     ] }; // Hiriq
>     key <AC08> { [ hebrew_lamed, 0x10020aa    ] }; // NIS
>     key <AC09> { [ hebrew_finalkaph, 0x100202c        ] }; // ADDED by potsatzi PDF
>     key <AC10> { [ hebrew_finalpe, colon      ] };
>     key <AC11> { [ comma, quotedbl            ] };
> 
>     key <AB01> { [ hebrew_zain, hebrew_zain   ] };
>     key <AB02> { [ hebrew_samech,0x10005b6    ] }; // Segol
>     key <AB03> { [ hebrew_bet, 0x10005bb      ] }; // Qubuts
>     key <AB04> { [ hebrew_he, 0x10005b1               ] }; // H. Segol
>     key <AB05> { [ hebrew_nun, 0x10005b2      ] }; // H. Patah
>     key <AB06> { [ hebrew_mem, 0x10005b3      ] }; // H.  Qamats
>     key <AB07> { [ hebrew_zade, 0x10005b5     ] }; // Tsere
>     key <AB08> { [ hebrew_taw, greater                ] };
>     key <AB09> { [ hebrew_finalzade, less     ] };
>     key <AB10> { [ period, question           ] };
> 
>     // Note the parens mirroring below:
>     key <AD11> { [ bracketright, braceright   ] };
>     key <AD12> { [ bracketleft, braceleft     ] };
>     key <AE01> { [ 1, exclam                  ] };
>     key <AE02> { [ 2, at                      ] };
>     key <AE03> { [ 3, numbersign              ] };
>     key <AE04> { [ 4, dollar                  ] };
>     key <AE05> { [ 5, percent                 ] };
>     key <AE06> { [ 6, asciicircum             ] };
>     key <AE07> { [ 7, ampersand                       ] };
>     key <AE08> { [ 8, asterisk                        ] };
>     key <AE09> { [ 9, parenright              ] };
>     key <AE10> { [ 0, parenleft                       ] };
> 
>     key <AE11> { [ minus, 0x10005be           ] }; // H. Hiphen
>     key <AE12> { [ equal, plus                        ] };
> };
> 
> 

potsatzi该文件的部分是/usr/share/X11/xkb/symbols/il上一部分的复制粘贴(好吧,在 VIM 中是复制粘贴),并进行了以下更改:

  • 该名称在两个地方从 更改lyxpotsatzi
  • 空白清理
  • ADDED by potsatzi我在 shift-char 位置添加了三个 Unicode 代码点,这些行具有添加的字符名称的注释。

除了添加别名/usr/share/X11/xkb/rules/base.lst、删除缓存文件/var/lib/xkb/以及重新启动系统之外,我还必须做什么才能让系统识别新的布局变体?

答案1

我发现了这个错误报告这给我指出了/usr/share/X11/xkb/rules/evdev.xml。除了OP问题中提到的所有其他努力之外,将以下行添加到文件中,重新启动后解决了问题:

    <variant>
      <configItem>
        <name>potsatzi</name>
        <description>Hebrew (Potsatzi)</description>
      </configItem>
    </variant>

我现在键盘上多了三个字符!!!!

相关内容