Skip to content

Wrong device detected for screen brightness #1163

@braska

Description

@braska

Describe the bug
Hyprpanel uses ls -w1 /sys/class/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/backlight

# result:

# appletb_backlight
# gmux_backlight

And head -1 returns appletb_backlight.

Because of that when I use slider in Hyprpanel the brightness of TouchBar is changed, instead of the brightness of the screen.

To Reproduce
Have a device with more than one element in /sys/class/backlight.

Expected behavior
To my knowledge there is no way to know (programmatically) which actual screen corresponds to the particular backlight device. So I would expect either: a) have all backlight devices controllable with individual slider (Hyprpanel shouldn't try understand what is what); b) give a config parameter to select which element from /sys/class/backlight should be used to control screen brightness

Desktop (please complete the following information):

  • Distribution: NixOS
  • Window Manager/Desktop Environment: Hyprland

Additional context
One more thing: it is not that important, but still annoying - I have some background daemon which controls TouchBar (tiny-dfr) and it changes the brightness of the touchbar after a few seconds on inactivity (no interaction with keyboard or touchbar). When it happens, HyprPanel shows OSD notifying me about decreased brightness. When I touch the touchpad/keyboard, tiny-dfr increases brightness of TouchBar again to 100%, which causes another OSD notification. It is just annoying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions