首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >重新启动后未检测到新的键盘布局变体

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

Unix & Linux用户
提问于 2021-10-27 13:19:16
回答 1查看 330关注 0票数 1

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

下面是对系统和我所做的更改的总结:

代码语言:javascript
复制
$ # 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  { [ 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  { [ slash, slash                       ] };
>     key  { [ apostrophe, apostrophe     ] };
>     key  { [ hebrew_qoph, 0x10005b8     ] }; // Qamats
>     key  { [ hebrew_resh, 0x10005bc     ] }; // Dagesh/Shuruq
>     key  { [ hebrew_aleph, 0x100200e    ] }; // LRM
>     key  { [ hebrew_tet, 0x100200f      ] }; // RLM
>     key  { [ hebrew_waw, 0x10005b9      ] }; // Holam
>     key  { [ hebrew_finalnun, 0x100202a ] }; // ADDED by potsatzi LRE
>     key  { [ hebrew_finalmem, 0x100202b ] }; // ADDED by potsatzi RLE
>     key  { [ hebrew_pe, 0x10005b7               ] }; // Patah
> 
>     key  { [ hebrew_shin, 0x10005b0     ] }; // Sheva
>     key  { [ hebrew_dalet, 0x10005bc    ] }; // Dagesh/Shuruq
>     key  { [ hebrew_gimel, hebrew_gimel ] };
>     key  { [ hebrew_kaph, hebrew_kaph   ] };
>     key  { [ hebrew_ayin, 0x10005c2     ] }; // Sin dot
>     key  { [ hebrew_yod, 0x10005c1      ] }; // Shin dot
>     key  { [ hebrew_chet, 0x10005b4     ] }; // Hiriq
>     key  { [ hebrew_lamed, 0x10020aa    ] }; // NIS
>     key  { [ hebrew_finalkaph, 0x100202c        ] }; // ADDED by potsatzi PDF
>     key  { [ hebrew_finalpe, colon      ] };
>     key  { [ comma, quotedbl            ] };
> 
>     key  { [ hebrew_zain, hebrew_zain   ] };
>     key  { [ hebrew_samech,0x10005b6    ] }; // Segol
>     key  { [ hebrew_bet, 0x10005bb      ] }; // Qubuts
>     key  { [ hebrew_he, 0x10005b1               ] }; // H. Segol
>     key  { [ hebrew_nun, 0x10005b2      ] }; // H. Patah
>     key  { [ hebrew_mem, 0x10005b3      ] }; // H.  Qamats
>     key  { [ hebrew_zade, 0x10005b5     ] }; // Tsere
>     key  { [ hebrew_taw, greater                ] };
>     key  { [ hebrew_finalzade, less     ] };
>     key  { [ period, question           ] };
> 
>     // Note the parens mirroring below:
>     key  { [ bracketright, braceright   ] };
>     key  { [ bracketleft, braceleft     ] };
>     key  { [ 1, exclam                  ] };
>     key  { [ 2, at                      ] };
>     key  { [ 3, numbersign              ] };
>     key  { [ 4, dollar                  ] };
>     key  { [ 5, percent                 ] };
>     key  { [ 6, asciicircum             ] };
>     key  { [ 7, ampersand                       ] };
>     key  { [ 8, asterisk                        ] };
>     key  { [ 9, parenright              ] };
>     key  { [ 0, parenleft                       ] };
> 
>     key  { [ minus, 0x10005be           ] }; // H. Hiphen
>     key  { [ equal, plus                        ] };
> };
> 
> 

potsatzi文件的/usr/share/X11/xkb/symbols/il部分是上一节的复制粘贴(在VIM中是yank-D5),有以下更改:

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

Other比向 /usr/share/X11/xkb/rules/base.lst**添加别名、从** /var/lib/xkb/**删除缓存文件和重新启动系统,我还需要做什么才能让系统识别新的布局变体?*

EN

回答 1

Unix & Linux用户

回答已采纳

发布于 2021-10-27 13:38:51

我找到了这个错误报告,它把我指向了/usr/share/X11/xkb/rules/evdev.xml。除了OP问题中提到的所有其他工作之外,在文件中添加以下行,在重新启动之后解决了这个问题:

代码语言:javascript
复制
        potsatzi
        Hebrew (Potsatzi)

我现在的键盘上还有三个字符!

票数 1
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/674997

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档