Regression: keyboard_layout block fails to get current layout from sway
I updated my system yesterday and i3status-rust (0.33.2) now fails to get the keyboard layout from sway. I changed no config whatsoever.
This was previously working:
[[block]]
block = "keyboard_layout"
driver = "sway"
format = "$layout"
sway_kb_identifier = "1:1:AT_Translated_Set_2_keyboard"
[block.mappings]
"English (US, alt. intl.)" = "EN"
"Portuguese (Brazil, IBM/Lenovo ThinkPad)" = "PT"
But now I get this output:
$ i3status-rs ./config-main.toml
{"version": 1, "click_events": true}
[
[{"full_text":"|","color":"#A9A9A9FF","background":"#000000FF","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":" ","color":"#DC322FFF","background":"#000000FF","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"},{"full_text":"failed to get current input ","color":"#DC322FFF","background":"#000000FF","name":"0","instance":"0:","separator":false,"separator_block_width":0,"markup":"pango"}],
^C
Not sure how to troubleshoot this further, any ideas?
Can you share the output of swaymsg -t get_inputs?
Sure:
❯ swaymsg -t get_inputs
Input device: Logitech Wireless Mouse MX Master 3
Type: Mouse
Identifier: 1133:45091:Logitech_Wireless_Mouse_MX_Master_3
Product ID: 45091
Vendor ID: 1133
Libinput Send Events: enabled
Input device: Logitech Wireless Mouse MX Master 3
Type: Keyboard
Identifier: 1133:45091:Logitech_Wireless_Mouse_MX_Master_3
Product ID: 45091
Vendor ID: 1133
Active Keyboard Layout: Portuguese (Brazil, IBM/Lenovo ThinkPad)
Libinput Send Events: enabled
Input device: ThinkPad Extra Buttons
Type: Keyboard
Identifier: 6058:20564:ThinkPad_Extra_Buttons
Product ID: 20564
Vendor ID: 6058
Active Keyboard Layout: Portuguese (Brazil, IBM/Lenovo ThinkPad)
Libinput Send Events: enabled
Input device: TPPS/2 Elan TrackPoint
Type: Mouse
Identifier: 2:10:TPPS/2_Elan_TrackPoint
Product ID: 10
Vendor ID: 2
Libinput Send Events: enabled
Input device: AT Translated Set 2 keyboard
Type: Keyboard
Identifier: 1:1:AT_Translated_Set_2_keyboard
Product ID: 1
Vendor ID: 1
Active Keyboard Layout: Portuguese (Brazil, IBM/Lenovo ThinkPad)
Libinput Send Events: enabled
Input device: ELAN067F:00 04F3:3209 Touchpad
Type: Touchpad
Identifier: 1267:12809:ELAN067F:00_04F3:3209_Touchpad
Product ID: 12809
Vendor ID: 1267
Libinput Send Events: enabled
Input device: ELAN067F:00 04F3:3209 Mouse
Type: Mouse
Identifier: 1267:12809:ELAN067F:00_04F3:3209_Mouse
Product ID: 12809
Vendor ID: 1267
Libinput Send Events: enabled
Input device: Kinesis Advantage2 Keyboard System Control
Type: Keyboard
Identifier: 10730:258:Kinesis_Advantage2_Keyboard_System_Control
Product ID: 258
Vendor ID: 10730
Active Keyboard Layout: Portuguese (Brazil, IBM/Lenovo ThinkPad)
Libinput Send Events: enabled
Input device: Kinesis Advantage2 Keyboard Consumer Control
Type: Keyboard
Identifier: 10730:258:Kinesis_Advantage2_Keyboard_Consumer_Control
Product ID: 258
Vendor ID: 10730
Active Keyboard Layout: Portuguese (Brazil, IBM/Lenovo ThinkPad)
Libinput Send Events: enabled
Input device: Kinesis Advantage2 Keyboard
Type: Keyboard
Identifier: 10730:258:Kinesis_Advantage2_Keyboard
Product ID: 258
Vendor ID: 10730
Active Keyboard Layout: English (US, alt. intl.)
Libinput Send Events: enabled
Input device: Kinesis Advantage2 Keyboard
Type: Mouse
Identifier: 10730:258:Kinesis_Advantage2_Keyboard
Product ID: 258
Vendor ID: 10730
Libinput Send Events: enabled
Input device: Sleep Button
Type: Keyboard
Identifier: 0:3:Sleep_Button
Product ID: 3
Vendor ID: 0
Active Keyboard Layout: Portuguese (Brazil, IBM/Lenovo ThinkPad)
Libinput Send Events: enabled
Input device: Lid Switch
Type: Switch
Identifier: 0:5:Lid_Switch
Product ID: 5
Vendor ID: 0
Libinput Send Events: enabled
Input device: Power Button
Type: Keyboard
Identifier: 0:1:Power_Button
Product ID: 1
Vendor ID: 0
Active Keyboard Layout: Portuguese (Brazil, IBM/Lenovo ThinkPad)
Libinput Send Events: enabled
Input device: Video Bus
Type: Keyboard
Identifier: 0:6:Video_Bus
Product ID: 6
Vendor ID: 0
Active Keyboard Layout: Portuguese (Brazil, IBM/Lenovo ThinkPad)
Libinput Send Events: enabled
Input device: Power Button
Type: Keyboard
Identifier: 0:1:Power_Button
Product ID: 1
Vendor ID: 0
Active Keyboard Layout: Portuguese (Brazil, IBM/Lenovo ThinkPad)
Libinput Send Events: enabled
The sway_kb_identifier is there with the correct value:
❯ swaymsg -t get_inputs | jq '.[] | select(.identifier == "1:1:AT_Translated_Set_2_keyboard")'
{
"identifier": "1:1:AT_Translated_Set_2_keyboard",
"name": "AT Translated Set 2 keyboard",
"type": "keyboard",
"repeat_delay": 600,
"repeat_rate": 25,
"xkb_layout_names": [
"Portuguese (Brazil, IBM/Lenovo ThinkPad)",
"English (US, alt. intl.)"
],
"xkb_active_layout_index": 0,
"xkb_active_layout_name": "Portuguese (Brazil, IBM/Lenovo ThinkPad)",
"libinput": {
"send_events": "enabled"
},
"vendor": 1,
"product": 1
}
I had the same problem, and it might have something to do with xdg-desktop-portal, because after toggling it in my home-manager the issue went gone
xdg.portal = {
enable = true;
xdgOpenUsePortal = true;
configPackages = [pkgs.sway];
extraPortals = [
pkgs.xdg-desktop-portal-wlr
pkgs.xdg-desktop-portal-gtk
];
};
I updated my machine and the issue is gone now. Not sure what fixed it, but it is fixed.
I had the same problem, and it might have something to do with
xdg-desktop-portal
I already had the gtk XDG portal, not sure it was it that caused the bug.