Describe the bug
Hyprpanel uses ls -w1 /sys/class/leds | grep '::kbd_backlight$' | head -1 to detect screen device and later use it in --device flag for brightnessctl. This code is based on certain assumptions that are not always true. For example, on my Macbook with T2 Linux (NixOS) I see this:
# command
ls -w1 /sys/class/leds
# result:
# input2::capslock
# input2::compose
# input2::kana
# input2::numlock
# input2::scrolllock
# :white:kbd_backlight
Particularly, grep '::kbd_backlight$' is problematic. It filters out :white:kbd_backlight and doesn't pick it.
Because of that Hyprpanel can't detect that I have controllable keyboard brightness.
To Reproduce
🤷
Expected behavior
I would expect some kind of fallback. E.g. HyprPanel could do (ls -w1 /sys/class/leds | grep '::kbd_backlight$' || ls -w1 /sys/class/leds | grep ':white:kbd_backlight$') | head -1
Desktop (please complete the following information):
- Distribution: NixOS
- Window Manager/Desktop Environment: Hyprland
Describe the bug
Hyprpanel uses
ls -w1 /sys/class/leds | grep '::kbd_backlight$' | head -1to detect screen device and later use it in--deviceflag forbrightnessctl. This code is based on certain assumptions that are not always true. For example, on my Macbook with T2 Linux (NixOS) I see this:Particularly,
grep '::kbd_backlight$'is problematic. It filters out:white:kbd_backlightand doesn't pick it.Because of that Hyprpanel can't detect that I have controllable keyboard brightness.
To Reproduce
🤷
Expected behavior
I would expect some kind of fallback. E.g. HyprPanel could do
(ls -w1 /sys/class/leds | grep '::kbd_backlight$' || ls -w1 /sys/class/leds | grep ':white:kbd_backlight$') | head -1Desktop (please complete the following information):