swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.57k stars 1.11k forks source link

Allow applications to read {caps,num,scroll} lock status #4889

Open setpill opened 4 years ago

setpill commented 4 years ago

Currently keyboard layout information is exposed through GET_INPUTS; it would be useful to also be able to read the status of the different keyboard locks. An example usecase would be to implement on-screen keyboard lock indicators in waybar; useful if there's no hardware indicator leds.

Ideally any change in these would also be exposed through the INPUT event.

PhilippeOlivier commented 9 months ago

To work around this limitation, I used to use inotifywait on /sys/class/leds/input*::capslock/brightness in a script to monitor the caps lock status. But inotifywait is spotty on /sys (depending on the kernel version) and this solution recently broke after an update. Being able to monitor the locks through swaymsg would be great.