Skip to content

Implement logind's SetBrightness() method #152

Description

@jpetso

From https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.login1.html (Session interface):

       SetBrightness(in  s subsystem,
                    in  s name,
                    in  u brightness);

SetBrightness() may be used to set the display brightness. This is intended to be used by the desktop environment and allows unprivileged programs to access hardware settings in a controlled way. The subsystem parameter specifies a kernel subsystem, either "backlight" or "leds". The name parameter specifies a device name under the specified subsystem. The brightness parameter specifies the brightness. The range is defined by individual drivers, see /sys/class/subsystem/name/max_brightness.

I've been writing some code for KDE Plasma to use this method for display backlight brightness changes, instead of the root-privilege KAuth helper binary. It would simplify the code a bunch if the KAuth fallback could be removed at least on Linux.

Extra bonus points for a FreeBSD implementation that would allow even further code unification. Plasma for FreeBSD uses a different code path (also with KAuth helper binary), I don't currently know enough details about BSD display/brightness setters to tell whether or not logind's SetBrightness() can feasibly implemented there as well.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions