diff options
-rw-r--r-- | polkit-1/actions/com.sigexec.polkit.set-brightness.policy | 21 | ||||
-rw-r--r-- | polkit-1/rules/90-set-brightness.rules | 9 |
2 files changed, 30 insertions, 0 deletions
diff --git a/polkit-1/actions/com.sigexec.polkit.set-brightness.policy b/polkit-1/actions/com.sigexec.polkit.set-brightness.policy new file mode 100644 index 0000000..352e8bf --- /dev/null +++ b/polkit-1/actions/com.sigexec.polkit.set-brightness.policy @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD polkit Policy Configuration 1.0//EN" +"http://www.freedesktop.org/software/polkit/policyconfig-1.dtd"> +<policyconfig> + + <vendor>Olivier Gayot</vendor> + <vendor_url>http://sigexec.com</vendor_url> + + <action id="com.sigexec.polkit.set-brightness"> + <description>Set the brightness of the monitor</description> + <description xml:lang="fr">Règle la luminosité de l'écran</description> + <defaults> + <allow_any>no</allow_any> + <allow_inactive>no</allow_inactive> + <allow_active>auth_admin_keep</allow_active> + </defaults> + <annotate key="org.freedesktop.policykit.exec.path">/usr/local/bin/brightness</annotate> + <annotate key="org.freedesktop.policykit.exec.argv1">set</annotate> + </action> + +</policyconfig> diff --git a/polkit-1/rules/90-set-brightness.rules b/polkit-1/rules/90-set-brightness.rules new file mode 100644 index 0000000..f8b158a --- /dev/null +++ b/polkit-1/rules/90-set-brightness.rules @@ -0,0 +1,9 @@ +polkit.addRule(function(action, subject) { + if (1 + && action.id == "com.sigexec.polkit.set-brightness" + && subject.seat == "seat0" + ) + { + return polkit.Result.YES; + } +}); |