Comment 5 for bug 1252507

Revision history for this message
Mahiar Mody (mahiarmody) wrote :

Hello Sebastien,

The gnome team came back with a "Not A Bug". Here's the reply (from Bastien Nocera [gnome-settings-daemon developer] ):

"The pkexec helper doesn't work but the brightness slider works. That means that
gnome-settings-daemon works, and that it's using XRandR and not the pkexec
helper to change the brightness.

You can double-check that with:
xrandr -q --verbose | grep -i backlight

Furthermore, the pkexec helper isn't public API. The public API is through
D-Bus."

Any idea on how to fix this? Or is there a better way to do it? I tried with DBus as shown below, but had questionable success:

dbus-send --session --print-reply --dest="org.gnome.SettingsDaemon" /org/gnome/SettingsDaemon/Power org.gnome.SettingsDaemon.Power.Screen.SetPercentage uint32:percentage

For Example: To set brightness to 30%

dbus-send --session --print-reply --dest="org.gnome.SettingsDaemon" /org/gnome/SettingsDaemon/Power org.gnome.SettingsDaemon.Power.Screen.SetPercentage uint32:30

When the above-mentioned dbus-send command is issued, the slider in the GUI is correctly positioned to reflect the percentage requested, but the brightness is not always altered to match.

Put another way, the dbus-send reliably only changes the slider position. However, the brightness is not always changed with the slider movement. The brightness changes sometimes, while sometimes remains unaltered. This happens randomly.

Any suggestions?

Any way to get pkexec to work?