draft: add generic layout detection to keyboard-state#4430
Conversation
cec4b5c to
72f872f
Compare
72f872f to
03d4b00
Compare
03d4b00 to
a2cd205
Compare
|
I can't get this to work in either sway or hyprland... Caps and Num lock status are always shown as unlocked - it doesn't update at the start or when either key is toggled. The tooltip works, sometimes. Format codes set to show any aspect of the keyboard layout do not update at the beginning or when layout/variant is changed - it always contains the info from the first configured layout. I don't know if I'm missing something... I merged this PR into a local copy of the master branch. I think the stock keyboard_state module mentions adding your user to the input group, but I find that unacceptable and a security risk. I don't know if that's part of the issue or what. I'd love to have a straight up wayland way to do all of these things: num/caps lock status, current keyboard layout info. |
Fixes #4101, #4184, and potentially some others. This also has the potential to replace the language modules for sway, hyprland, and niri.
As a first step, I re-implemented the keyboard-state module to use the keyboard information provided by wayland rather than libinput. In a second step, I added layout detection based on that same information.
This works for me (on labwc), but at the same time it sounds too good to be true. So there might well be a huge downside to this approach that I am not aware of.
Currently this is a rough draft and could use some cleanup. But I wanted to get feedback on the general approach before spending too much time.