-
Martin Pitt authored
installed by newer distros any more, so it's time to get rid of the HAL brightness backend entirely, so drop it. Since there are still X.org drivers which do not support brightness setting through XRandR, add a xfpm-power-backlight-helper program which reads/writes brightness setting in /sys/class/backlight/, and use it as a fallback if XRandR brightness isn't available. Reading doesn't require any privileges, but for writing the helper needs to be run as root through pkexec, so add a default policy which allows running that without a password for the local foreground console. This was inspired from gnome-power-manager: http://git.gnome.org/browse/gnome-power-manager/commit/?id=4886023c and the helper code comes from gpm, with slight adaptions.
Martin Pitt authoredinstalled by newer distros any more, so it's time to get rid of the HAL brightness backend entirely, so drop it. Since there are still X.org drivers which do not support brightness setting through XRandR, add a xfpm-power-backlight-helper program which reads/writes brightness setting in /sys/class/backlight/, and use it as a fallback if XRandR brightness isn't available. Reading doesn't require any privileges, but for writing the helper needs to be run as root through pkexec, so add a default policy which allows running that without a password for the local foreground console. This was inspired from gnome-power-manager: http://git.gnome.org/browse/gnome-power-manager/commit/?id=4886023c and the helper code comes from gpm, with slight adaptions.
org.xfce.power.policy.in2 1.14 KiB
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
<policyconfig>
<!--
Policy definitions for XFCE Power Manager system-wide actions.
Copyright (c) 2010 Richard Hughes <richard@hughsie.com>
-->
<vendor>XFCE Power Manager</vendor>
<vendor_url>http://goodies.xfce.org/projects/applications/xfce4-power-manager</vendor_url>
<icon_name>battery</icon_name>
<action id="org.xfce.power.backlight-helper">
<!-- SECURITY:
- A normal active user on the local machine does not need permission
to change the backlight brightness.
-->
<_description>Modify the laptop display brightness</_description>
<_message>Authentication is required to modify the laptop display brightness</_message>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">@sbindir@/xfpm-power-backlight-helper</annotate>
</action>
</policyconfig>