ErikReider/SwayOSD

Keyboard backlight

otaj opened this issue · 7 comments

otaj commented

Hi, it would be a great improvement, if swayosd-libinput-backend could also listen to keyboard backlight and show an OSD window.

Thank you for the great project!

I've actually tested this on my Thinkpad but it doesn't seem to register... Are you able to use the XF86KbdBrightnessUp in a bind in Sway or any other compositor?

otaj commented

Hi, sorry, was on a vacation for a week. I'm using sway, but I have not set up a XF86KbdBrightnessUp keybind, and keyboard brightness "just works" out of the box. I'm also on a Thinkpad (T14 Gen2), I'm thinking it has be some sort of shenanigans from either libinput or some thinkpad driver.

Interestingly enough, when trying to capture keycodes using wev, my keyboard backlight switch (Fn + Space as printed on the keyboard) does not register at all.

I'm using sway, but I have not set up a XF86KbdBrightnessUp keybind, and keyboard brightness "just works" out of the box

my keyboard backlight switch (Fn + Space as printed on the keyboard) does not register at all

Exactly what I was trying to articulate above :)

Not sure how to get it working. Gnome seems to somehow get the key events so I'm not sure how this would be done...

Any ideas? :)

otaj commented

It seems to be kernel module. My personal laptop is Dell, with Fn+F5 combo for keyboard backlight, which also does not get registered in wev, however the files exposed in /sys/class/leds are generated by dell-laptop kernel module.

So, I guess hooking into kernel modules sounds like very much out of scope for this project. 😆

It seems to be kernel module. My personal laptop is Dell, with Fn+F5 combo for keyboard backlight, which also does not get registered in wev, however the files exposed in /sys/class/leds are generated by dell-laptop kernel module.

So, I guess hooking into kernel modules sounds like very much out of scope for this project. laughing

Good to know! Thanks for looking into it! Seems a bit too complicated so might look into how Gnome does it and get some "inspiration" :)

Hi, just checking in, I just found out that at least on my personal laptop (Dell), the information of changing keyboard backlight is relayed through /sys/class/leds/dell::kbd_backlight/brightness_hw_changed. If I setup inotify watch on this file, whenever I change keyboard backlight, this file gets modified. That might help :)

Hi, just checking in, I just found out that at least on my personal laptop (Dell), the information of changing keyboard backlight is relayed through /sys/class/leds/dell::kbd_backlight/brightness_hw_changed. If I setup inotify watch on this file, whenever I change keyboard backlight, this file gets modified. That might help :)

Oh, that's a really good find! I'll look into it! :)