我在 Linux 上使用美国默认键盘,但有时需要德语特殊字符。我在添加了字符的文件夹中制作了自己的文件版本us
。usr/share/X11/xkb/symbols
这有效,但总是在有更新时被覆盖。
我看到文件中有一个“德国、瑞典和芬兰(美国)”(de_se_fi)布局us
。所以我想我会尝试那个。但是,我在设置中找不到任何美式键盘的“德语”变体来选择它们。
更新
我发现它可能在 中丢失usr/share/X11/xkb/rules/base.lst
,所以我尝试添加它:
这些是中的行usr/share/X11/xkb/symbols/us
:
// German and Swedish characters added as third level symbols to the US keyboard layout
// Author: Stephan Lachnit <[email protected]>, 2019
// the german umlauts are placed over the characters without diaeresis, the sharp-s over the s
// the swedish ao is placed over the p, since it's closed to the position on a swedish keyboard
// the euro sign is placed over the e, as it is usual for german and swedish keyboards
partial alphanumeric_keys
xkb_symbols "de_se_fi" {
include "us(basic)"
include "eurosign(e)"
name[Group1] = "German, Swedish and Finnish (US)";
key <AC01> {[ a, A, adiaeresis, Adiaeresis ]};
key <AC02> {[ s, S, ssharp, U1E9E ]};
key <AD01> {[ q, Q, at ]};
key <AD07> {[ u, U, udiaeresis, Udiaeresis ]};
key <AD09> {[ o, O, odiaeresis, Odiaeresis ]};
key <AD10> {[ p, P, aring, Aring ]};
key <AD12> {[ bracketright, braceright, asciitilde ]};
include "level3(ralt_switch)"
};
我将此行添加到base.lst
(在该! variant
部分下):
de_se_fi us: German, Swedish and Finnish (US)
我还尝试创建自己的布局usr/share/X11/xkb/symbols/cust_us_de
:
default partial alphanumeric_keys modifier_keys
xkb_symbols "basic" {
name[Group1]= "Custom US/DE Keyboard Layout";
include "us(basic)";
include "eurosign(e)";
key <AC01> {[ a, A, adiaeresis, Adiaeresis ]};
key <AC02> {[ s, S, ssharp, U1E9E ]};
key <AD07> {[ u, U, udiaeresis, Udiaeresis ]};
key <AD09> {[ o, O, odiaeresis, Odiaeresis ]};
};
并将这一行添加到base.lst
(在该! layout
部分下):
cust_us_de Custom US/DE Keyboard Layout
当我在“设置” → “键盘” → “输入源”中查找它们时,两者都没有出现(重启后也不出现)
有没有办法测试布局文件(例如usr/share/X11/xkb/symbols/cust_us_de
)是否正常工作或导致错误?或者一种查看base.lst
实际加载了哪些布局/变体的方法?
在编辑上述文件之一后,我是否需要重新启动或进行其他操作才能进行更改?还是关闭和打开设置对话框就足够了?
系统:Manjaro Gnome (wayland)