我有一个自定义键盘布局,像这样
input * xkb_layout custom
布局位于/usr/local/xkb/x11/symbols
....(类似这样)
它在终端上有效......但如果我打开勇敢
bindsym $mod+Ctrl+b exec brave-browser
它仍然使用默认布局,而不是我的自定义布局,但如果我切换到其他布局并返回,它就会按预期工作
alias asdf="swaymsg input type:keyboard xkb_layout custom"
alias aoeu="swaymsg input type:keyboard xkb_layout us"
然后它就aoeu
可以asdf
按预期工作了,但一开始它不起作用,这很烦人,而且它会定期将键盘重置回us
这是来自调试日志
122 │ 00:00:00.317 [DEBUG] [sway/config.c:824] Read line 13:
123 │ 00:00:00.317 [DEBUG] [sway/config.c:824] Read line 14: input * xkb_layout real-prog-dvorak
124 │ 00:00:00.317 [INFO] [sway/commands.c:378] Config command: input * xkb_layout real-prog-dvorak
125 │ 00:00:00.317 [INFO] [sway/commands.c:398] After replacement: input * xkb_layout real-prog-dvorak
126 │ 00:00:00.317 [DEBUG] [sway/commands/input.c:54] entering input block: *
127 │ 00:00:00.317 [DEBUG] [sway/config/input.c:15] new_input_config(*)
128 │ 00:00:00.317 [DEBUG] [sway/commands.c:429] Subcommand: xkb_layout real-prog-dvorak
129 │ 00:00:00.317 [DEBUG] [sway/commands/input/xkb_layout.c:18] set-xkb_layout for config: * layout: real-prog-dvorak
130 │ 00:00:00.317 [DEBUG] [sway/config/input.c:15] new_input_config(temp)
131 │ 00:00:00.322 [DEBUG] [sway/config/input.c:350] Config stored for input *
132 │ 00:00:00.325 [DEBUG] [sway/config.c:1055] Translated keysyms using config for device '*'
133 │ 00:00:00.325 [DEBUG] [sway/config.c:824] Read line 15:
...
ge2_Keyboard')
866 │ 00:00:01.058 [DEBUG] [sway/input/seat.c:939] adding device 10730:258:Kinesis_Advantage2_Keyboard to seat seat0
867 │ 00:00:01.092 [DEBUG] [wlr] [xcursor/wlr_xcursor.c:243] Loaded cursor theme 'default' at size 24 (88 available cursors)
868 │ 00:00:01.092 [DEBUG] [sway/input/seat.c:718] Applying input config to 10730:258:Kinesis_Advantage2_Keyboard
869 │ 00:00:01.092 [DEBUG] [wlr] [backend/libinput/events.c:95] Added Kinesis Advantage2 Keyboard [10730:258]
870 │ 00:00:01.092 [DEBUG] [sway/input/input-manager.c:234] adding device: '10730:258:Kinesis_Advantage2_Keyboard'
871 │ 00:00:01.092 [DEBUG] [sway/input/libinput.c:198] sway_input_configure_libinput_device('*' on '10730:258:Kinesis_Advantage2_Keyboard')
872 │ 00:00:01.092 [DEBUG] [sway/input/seat.c:939] adding device 10730:258:Kinesis_Advantage2_Keyboard to seat seat0
873 │ 00:00:01.097 [DEBUG] [sway/input/keyboard.c:912] Adding keyboard 10730:258:Kinesis_Advantage2_Keyboard to group 0x55b58fff7fb0
874 │ 00:00:01.098 [DEBUG] [wlr] [backend/libinput/events.c:95] Added Kinesis Advantage2 Keyboard Consumer Control [10730:258]
875 │ 00:00:01.098 [DEBUG] [sway/input/input-manager.c:234] adding device: '10730:258:Kinesis_Advantage2_Keyboard_Consumer_Control'
876 │ 00:00:01.098 [DEBUG] [sway/input/libinput.c:198] sway_input_configure_libinput_device('*' on '10730:258:Kinesis_Advantage2_Keyboard_Consumer_Control')
877 │ 00:00:01.098 [DEBUG] [sway/input/seat.c:939] adding device 10730:258:Kinesis_Advantage2_Keyboard_Consumer_Control to seat seat0
878 │ 00:00:01.103 [DEBUG] [sway/input/keyboard.c:912] Adding keyboard 10730:258:Kinesis_Advantage2_Keyboard_Consumer_Control to group 0x55b58fff7fb0
879 │ 00:00:01.105 [DEBUG] [wlr] [backend/libinput/events.c:95] Added Kinesis Advantage2 Keyboard System Control [10730:258]
880 │ 00:00:01.105 [DEBUG] [sway/input/input-manager.c:234] adding device: '10730:258:Kinesis_Advantage2_Keyboard_System_Control'
881 │ 00:00:01.105 [DEBUG] [sway/input/libinput.c:198] sway_input_configure_libinput_device('*' on '10730:258:Kinesis_Advantage2_Keyboard_System_Control')
882 │ 00:00:01.105 [DEBUG] [sway/input/seat.c:939] adding device 10730:258:Kinesis_Advantage2_Keyboard_System_Control to seat seat0
883 │ 00:00:01.109 [DEBUG] [sway/input/keyboard.c:912] Adding keyboard 10730:258:Kinesis_Advantage2_Keyboard_System_Control to group 0x55b58fff7fb0
884 │ 00:00:01.111 [DEBUG] [wlr] [backend/libinput/events.c:95] Added C270 HD WEBCAM [1133:2085]
885 │ 00:00:01.111 [DEBUG] [sway/input/input-manager.c:234] adding device: '1133:2085:C270_HD_WEBCAM'
886 │ 00:00:01.111 [DEBUG] [sway/input/libinput.c:198] sway_input_configure_libinput_device('*' on '1133:2085:C270_HD_WEBCAM')
887 │ 00:00:01.111 [DEBUG] [sway/input/seat.c:939] adding device 1133:2085:C270_HD_WEBCAM to seat seat0
888 │ 00:00:01.116 [DEBUG] [sway/input/keyboard.c:912] Adding keyboard 1133:2085:C270_HD_WEBCAM to group 0x55b58fff7fb0
889 │ 00:00:01.117 [DEBUG] [wlr] [backend/libinput/events.c:95] Added HP, Inc HyperX QuadCast Consumer Control [1008:1169]
890 │ 00:00:01.117 [DEBUG] [sway/input/input-manager.c:234] adding device: '1008:1169:HP,_Inc_HyperX_QuadCast_Consumer_Control'
891 │ 00:00:01.117 [DEBUG] [sway/input/libinput.c:198] sway_input_configure_libinput_device('*' on '1008:1169:HP,_Inc_HyperX_QuadCast_Consumer_Control')
892 │ 00:00:01.117 [DEBUG] [sway/input/seat.c:939] adding device 1008:1169:HP,_Inc_HyperX_QuadCast_Consumer_Control to seat seat0
893 │ 00:00:01.122 [DEBUG] [sway/input/keyboard.c:912] Adding keyboard 1008:1169:HP,_Inc_HyperX_QuadCast_Consumer_Control to group 0x55b58fff7fb0
894 │ 00:00:01.123 [DEBUG] [wlr] [backend/libinput/events.c:95] Added USB Optical Mouse [7119:5]
895 │ 00:00:01.123 [DEBUG] [sway/input/input-manager.c:234] adding device: '7119:5:USB_Optical_Mouse'
896 │ 00:00:01.123 [DEBUG] [sway/input/libinput.c:198] sway_input_configure_libinput_device('*' on '7119:5:USB_Optical_Mouse')
897 │ 00:00:01.123 [DEBUG] [sway/input/seat.c:939] adding device 7119:5:USB_Optical_Mouse to seat seat0
898 │ 00:00:01.123 [DEBUG] [sway/input/seat.c:718] Applying input config to 7119:5:USB_Optical_Mouse
899 │ 00:00:01.123 [DEBUG] [wlr] [backend/libinput/backend.c:133] libinput successfully initialized
...
1465 │ 00:00:16.114 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1466 │ 00:00:16.114 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1467 │ 00:00:16.114 [DEBUG] [wlr] [xwayland/xwm.c:833] unhandled X11 property 378 (_NET_WM_BYPASS_COMPOSITOR) for window 4194307
1468 │ 00:00:16.114 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1469 │ 00:00:16.114 [DEBUG] [wlr] [xwayland/xwm.c:833] unhandled X11 property 380 (_NET_WM_ICON) for window 4194307
1470 │ [4248:4268:0829/063613.713701:ERROR:object_proxy.cc(590)] Failed to call method: org.freedesktop.DBus.StartServiceByName: object_path= /org/freedesktop/DBus: org.freedesktop.DBus.Error.Spawn.ChildSignaled: Process org.freedesktop.Notifications rec
│ eived signal 11
1471 │ 00:00:16.255 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1472 │ 00:00:16.256 [DEBUG] [wlr] [xwayland/xwm.c:833] unhandled X11 property 299 (XdndAware) for window 4194307
1473 │ 00:00:16.256 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1474 │ 00:00:16.256 [DEBUG] [sway/tree/view.c:404] View 0x55b5903ea420 updated CSD to 0
1475 │ 00:00:16.308 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1476 │ 00:00:16.308 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1477 │ 00:00:16.309 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1478 │ 00:00:16.309 [DEBUG] [wlr] [xwayland/xwm.c:833] unhandled X11 property 381 (_NET_WM_OPAQUE_REGION) for window 4194307
1479 │ 00:00:16.311 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1480 │ 00:00:16.417 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1481 │ 00:00:16.417 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1482 │ 00:00:16.461 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1483 │ 00:00:16.461 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1484 │ 00:00:16.461 [DEBUG] [sway/desktop/xwayland.c:764] New xwayland unmanaged surface
1485 │ 00:00:16.461 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1486 │ 00:00:16.461 [DEBUG] [wlr] [xwayland/xwm.c:833] unhandled X11 property 387 (_NET_WM_USER_TIME) for window 4194307
1487 │ 00:00:16.462 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1488 │ 00:00:16.462 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1489 │ 00:00:16.462 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1490 │ 00:00:16.462 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1491 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/xwm.c:833] unhandled X11 property 342 (CHROMIUM_TIMESTAMP) for window 4194308
1492 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1493 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/xwm.c:833] unhandled X11 property 276 (WM_STATE) for window 4194307
1494 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1495 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1496 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1497 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1498 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1499 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1500 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1501 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1502 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1503 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/xwm.c:833] unhandled X11 property 381 (_NET_WM_OPAQUE_REGION) for window 4194307
1504 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/selection/selection.c:147] not handling selection events: no seat assigned to xwayland
1505 │ 00:00:16.520 [DEBUG] [wlr] [types/wlr_surface.c:748] New wlr_surface 0x55b5903e9f80 (res 0x55b5903efa10)
1506 │ 00:00:16.520 [DEBUG] [wlr] [xwayland/xwm.c:1674] New xwayland surface: 0x55b5903e9f80
1507 │ 00:00:16.520 [DEBUG] [sway/tree/view.c:404] View 0x55b5903ea420 updated CSD to 0
1508 │ 00:00:16.521 [DEBUG] [sway/tree/workspace.c:63] Adding workspace 4: for output DP-1
1509 │ 00:00:16.521 [DEBUG] [sway/ipc-server.c:306] Sending workspace::init event