重新啟動後未偵測到新的鍵盤佈局變體

重新啟動後未偵測到新的鍵盤佈局變體

我已在文件中新增了一個新部分/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>

我現在鍵盤上多了三個字元!

相關內容