Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

Keyboard state not work with external keyboard

Open vanarok opened this issue 2 years ago • 3 comments

I get a cyclic error if the external keyboard has been disconnected and even if plugged back in. I even set the device-path to the external keyboard, but still the same error. The workaround is to restart the waybar. [error] keyboard-state: Failed to sync evdev device: ENODEV No such device

vanarok avatar Jun 06 '22 11:06 vanarok

This is because the keyboard device path is assigned at the keyboard-state module initialization: https://github.com/Alexays/Waybar/blob/fd24d7bcf63476b8d3063e877752eedd0b661976/src/modules/keyboard_state.cpp#L122-L151 A temporary solution is, set the device-path in the config file. You can find your device in /dev/input/by-id or /dev/input/by-path, these paths won't change after reconnecting devices. But it still doesn't work if you don't connect it again. The better solution is using the internal keyboard in device-path.

asas1asas200 avatar Aug 22 '22 04:08 asas1asas200

This is because the keyboard device path is assigned at the keyboard-state module initialization:

https://github.com/Alexays/Waybar/blob/fd24d7bcf63476b8d3063e877752eedd0b661976/src/modules/keyboard_state.cpp#L122-L151

A temporary solution is, set the device-path in the config file. You can find your device in /dev/input/by-id or /dev/input/by-path, these paths won't change after reconnecting devices. But it still doesn't work if you don't connect it again. The better solution is using the internal keyboard in device-path.

Here is the problem. the thing is that the device-path is set and it does not change on the keyboard, and the waybar cannot read the state (see error and already mentioned) after I re-plug the external keyboard.

vanarok avatar Aug 22 '22 12:08 vanarok

@vanarok My latest commit implemented the hotplug function, hope this works for you.

asas1asas200 avatar Aug 23 '22 15:08 asas1asas200