如何让自定义键盘布局显示在 xfce4-keyboard-settings 布局选项中?

如何让自定义键盘布局显示在 xfce4-keyboard-settings 布局选项中?

我想使用 setxkbmap 创建并设置自定义键盘布局。我创建了~/.xkb/symbols/yr包含以下内容的文件:

partial default alphanumeric_keys
xkb_symbols "basic" {

    name[Group1]= "European (Dvorak)";

    key <TLDE>  { [       grave,   asciitilde,           dead_breve,       dead_abovering ] };

    key <AE01>  { [            1,      exclam,                U2216,           exclamdown ] };
    key <AE02>  { [            2,          at,               dagger,         doubledagger ] };
    key <AE03>  { [            3,  numbersign,             function,             sterling ] };
    key <AE04>  { [            4,      dollar,             EuroSign,                  yen ] };
    key <AE05>  { [            5,     percent,             permille,               degree ] };
    key <AE06>  { [            6, asciicircum,      dead_circumflex,           dead_caron ] };
    key <AE07>  { [            7,   ampersand,            paragraph,              section ] };
    key <AE08>  { [            8,    asterisk,          ordfeminine,            masculine ] };
    key <AE09>  { [            9,   parenleft,  leftdoublequotemark,  leftsinglequotemark ] };
    key <AE10>  { [            0,  parenright, rightdoublequotemark, rightsinglequotemark ] };
    key <AE11>  { [  bracketleft,   braceleft,        guillemotleft,                U2039 ] };
    key <AE12>  { [ bracketright,  braceright,       guillemotright,                U203A ] };

    key <AD01>  { [ apostrophe,   quotedbl,      aacute,       Aacute ] };
    key <AD02>  { [      comma,       less,      oacute,       Oacute ] };
    key <AD03>  { [     period,    greater,      eacute,       Eacute ] };
    key <AD04>  { [          p,          P,      uacute,       Uacute ] };
    key <AD05>  { [          y,          Y, ycircumflex,  Ycircumflex ] };
    key <AD06>  { [          f,          F,      ssharp,        U1E9E ] };
    key <AD07>  { [          g,          G,       U01F9,        U01F8 ] };
    key <AD08>  { [          c,          C,    ccedilla,     Ccedilla ] };
    key <AD09>  { [          r,          R,  adiaeresis,   Adiaeresis ] };
    key <AD10>  { [          l,          L,      oe,     OE ]   };
    key <AD11>  { [      slash,   question,    notsign, questiondown ] };
    key <AD12>  { [      equal,       plus,    multiply,     division ] };

    key <AC01>  { [         a,          A,      acircumflex, Acircumflex ] };
    key <AC02>  { [         o,          O,      ocircumflex, Ocircumflex ] };
    key <AC03>  { [         e,          E,      ecircumflex, Ecircumflex ] };
    key <AC04>  { [         u,          U,      ucircumflex, Ucircumflex ] };
    key <AC05>  { [         i,          I,      icircumflex, Icircumflex ] };
    key <AC06>  { [         d,          D,      U1E11,             U1E10 ] };
    key <AC07>  { [         h,          H,      dstroke,             Eth ] };
    key <AC08>  { [         t,          T,      thorn,             Thorn ] };
    key <AC09>  { [         n,          N,      ntilde,           Ntilde ] };
    key <AC10>  { [         s,          S,      scedilla,       Scedilla ] };
    key <AC11>  { [     minus, underscore,      U2014,          overline ] };

    key <AB01>  { [ semicolon,      colon, agrave,  Agrave ] };
    key <AB02>  { [         q,          Q, ograve,  Ograve ] };
    key <AB03>  { [         j,          J, egrave,  Egrave ] };
    key <AB04>  { [         k,          K, ugrave,  Ugrave ] };
    key <AB05>  { [         x,          X,  U0175,   U0174 ] };
    key <AB06>  { [         b,          B, iacute,  Iacute ] };
    key <AB07>  { [         m,          M, yacute,  Yacute ] };
    key <AB08>  { [         w,          W, oslash,  Oslash ] };
    key <AB09>  { [         v,          V,  U1E8B,   U1E8A ] };
    key <AB10>  { [         z,          Z,  U0225,   U0224 ] };
    key <AC12>  { [ backslash,        bar,     ae,      AE ] };



    // key <JPCM> { [ ] }; // KPJPComma
    // key <AE13> { [ ] }; // Yen
    // key <I120> { [ ] }; // KEY_MACRO      
    // key <I149> { [ ] }; // KEY_SETUP   
    // key <I154> { [ ] }; // KEY_DELETEFILE 
    // key <I168> { [ ] }; // KEY_CLOSECD    
    // key <I178> { [ ] }; // KEY_ISO  
    // key <I183> { [ ] }; // KEY_MOVE   
    // key <I184> { [ ] }; // KEY_EDIT  
    // key <I217> { [ ] }; // KEY_BASSBOOST 
    // key <I219> { [ ] }; // KEY_HP    
    // key <I221> { [ ] }; // KEY_SOUND
    // key <I222> { [ ] }; // KEY_QUESTION
    // key <I230> { [ ] }; // KEY_ALTERASE
    // key <I247> { [ ] }; // KEY_UWB
    // key <I248> { [ ] }; // KEY_UNKNOWN
    // key <I249> { [ ] }; // KEY_VIDEO_NEXT
    // key <I250> { [ ] }; // KEY_VIDEO_PREV
    // key <I251> { [ ] }; // KEY_BRIGHTNESS_CYCLE
    // key <I252> { [ ] }; // KEY_BRIGHTNESS_ZERO
    // key <I253> { [ ] }; // KEY_DISPLAY_OFF
    // key <FK19> { [ ] }; // 197?
    // key <FK24> { [ ] }; // 202?

    include "level3(ralt_switch)"
    include "level3(lwin_switch)"
}; 

我已经加载了它setxkbmap -I ~/.xkb/ yr -print | xkbcomp -I$HOME/.xkb - $DISPLAY并且它可以工作,这很好,但它不在 xfce4-keyboard-settings 中。

我需要做什么才能进入那里?

我创建的文件~/.xkb/rules/evdev.xml没有任何效果。

<layout>
    <configItem>
        <name>yr</name>
        <shortDescription>yr</shortDescription>
        <description>European (European, Dvorak)</description>
        <languageList>
          <iso639Id>eur</iso639Id>
        </languageList>
    </configItem>
    <variantList/>
</layout>

另外,当我尝试以这种方式设置键盘布局时,为什么会出现错误?:

[me@myComputer ~]$ setxkbmap -I ~/.xkb/ yr
Error loading new keyboard description

另一个奇怪的地方是当我使用 xkbcomp 时收到许多警告。

[me@myComputer ~]$ setxkbmap -I ~/.xkb/ yr -print  | xkbcomp -I$HOME/.xkb - $DISPLAY
Warning:          Key <OUTP> not found in evdev+aliases(qwerty) keycodes
                  Symbols ignored
Warning:          Key <KITG> not found in evdev+aliases(qwerty) keycodes
                  Symbols ignored
Warning:          Key <KIDN> not found in evdev+aliases(qwerty) keycodes
                  Symbols ignored
Warning:          Key <KIUP> not found in evdev+aliases(qwerty) keycodes
                  Symbols ignored
Warning:          Key <RO> not found in evdev+aliases(qwerty) keycodes
                  Symbols ignored
Warning:          Key <I192> not found in evdev+aliases(qwerty) keycodes
                  Symbols ignored
Warning:          Key <I193> not found in evdev+aliases(qwerty) keycodes
                  Symbols ignored
Warning:          Key <I194> not found in evdev+aliases(qwerty) keycodes
                  Symbols ignored
Warning:          Key <I195> not found in evdev+aliases(qwerty) keycodes
                  Symbols ignored
Warning:          Key <I196> not found in evdev+aliases(qwerty) keycodes
                  Symbols ignored
Warning:          Key <I255> not found in evdev+aliases(qwerty) keycodes
                  Symbols ignored
Warning:          No symbols defined for <AB11> (keycode 97)
Warning:          No symbols defined for <JPCM> (keycode 103)
Warning:          No symbols defined for <I120> (keycode 120)
Warning:          No symbols defined for <AE13> (keycode 132)
Warning:          No symbols defined for <I149> (keycode 149)
Warning:          No symbols defined for <I154> (keycode 154)
Warning:          No symbols defined for <I168> (keycode 168)
Warning:          No symbols defined for <I178> (keycode 178)
Warning:          No symbols defined for <I183> (keycode 183)
Warning:          No symbols defined for <I184> (keycode 184)
Warning:          No symbols defined for <FK19> (keycode 197)
Warning:          No symbols defined for <FK24> (keycode 202)
Warning:          No symbols defined for <I217> (keycode 217)
Warning:          No symbols defined for <I219> (keycode 219)
Warning:          No symbols defined for <I221> (keycode 221)
Warning:          No symbols defined for <I222> (keycode 222)
Warning:          No symbols defined for <I230> (keycode 230)
Warning:          No symbols defined for <I247> (keycode 247)
Warning:          No symbols defined for <I248> (keycode 248)
Warning:          No symbols defined for <I249> (keycode 249)
Warning:          No symbols defined for <I250> (keycode 250)
Warning:          No symbols defined for <I251> (keycode 251)
Warning:          No symbols defined for <I252> (keycode 252)
Warning:          No symbols defined for <I253> (keycode 253)

答案1

尝试打开 xfce4 设置管理器 ( Menu > Settings > Settings Manager),单击键盘图标,切换到Layout选项卡,取消选中Use system defaults,然后只需单击添加按钮!

如果这不起作用,您可能需要添加它/usr/share/X11/xkb/symbols/才能显示。

祝你好运!

相关内容