Refactor brightness handling to use logind
Currently screen brightness handling for internal laptop screens is handled mostly in backlighthelper.cpp
It is done via KAuth because writing to the sysfs required priviledges. However the helper also does things that do not require priviledges, like listing/selecting which sysfs entry to use. Doing more than necessary in the helper is always a smell. The listing code is quite complex because the backlight API is a mess. To make things more complicated there's also FreeBSD code in there which is quite different.
Since a while logind has SetBrightness (https://www.freedesktop.org/software/systemd/man/org.freedesktop.login1.html) to set the brightness for a given sysfs entry without requiring priviledges. Gnome uses that (https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/merge_requests/142)
In plasma-workspace!3178 (comment 737473) we found that using KAuth comes with significant overhead and that using logind can speed things up a lot.
We should
- refactor the code so that listing the devices is done outside of the KAuth helper
- use logind instead of KAuth for the actual writing if available