Waybar
Waybar copied to clipboard
Keyboard state not work with external keyboard
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
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
.
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 indevice-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 My latest commit implemented the hotplug function, hope this works for you.