On 7/23/24 1:46 AM, Andrei Borzenkov wrote:
Just use systemd-logind D-Bus API, like
``` busctl call org.freedesktop.login1 /org/freedesktop/login1/session/auto org.freedesktop.login1.Session SetBrightness "ssu" "backlight" "amdgpu_bl0" 4711 ```
or appropriate bindings for the language you are using.
See
https://www.freedesktop.org/software/systemd/man/latest/org.freedesktop.logi...
for details.
Thank you Andrei, Very nice, and I was about to go messing with kdesu (the -f file option looked nice, and the use in the .desktop file was attractive). Time to learn systemd-logind. The other option I was considering was trying to use Linux capabilities and perhaps the CAP_SYS_RAWIO capability. I'll have to learn something new either way. This is just plain old C++ and Qt Designer -- that I end up fighting with to not overwrite my damn files (I know that's what it's supposed to do, but after I tweak the header and source file generated from the ui by the moc -- I just want it to leave the files alone ... :) Designer is too limited to know about other classes I want to integrate with the dialog to use the slider/spinbox value change signal connected to the custom set_backlight slot of another widget. No doubt I need to refactor to eliminate that problem and just inherit from the Designer class. More gui practice needed. -- David C. Rankin, J.D.,P.E.