SwayOSD icon indicating copy to clipboard operation
SwayOSD copied to clipboard

Keyboard backlight

Open otaj opened this issue 2 years ago • 10 comments

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!

otaj avatar Jul 28 '23 07:07 otaj

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?

ErikReider avatar Jul 28 '23 14:07 ErikReider

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.

otaj avatar Aug 07 '23 07:08 otaj

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? :)

ErikReider avatar Aug 07 '23 14:08 ErikReider

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:

otaj avatar Aug 07 '23 17:08 otaj

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" :)

ErikReider avatar Aug 11 '23 08:08 ErikReider

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 :)

otaj avatar Nov 27 '23 09:11 otaj

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! :)

ErikReider avatar Dec 08 '23 13:12 ErikReider

according to https://wiki.archlinux.org/title/Keyboard_backlight this only works for devices where the backlight is controllable via an XF86 keycode

werdahias avatar Jan 25 '25 23:01 werdahias