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.
From https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.login1.html (Session interface):
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.