From 0527d1069a879cd9200e56a5f68f86461a019fb7 Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 29 Nov 2018 22:15:28 +0100 Subject: Add policykit configuration to allow setting as user When the script is installed as /usr/local/bin/brightness, the policykit configuration files allow the user sitting in front of the computer to set the brightness as a non-privileged user. Signed-off-by: Olivier Gayot --- .../com.sigexec.polkit.set-brightness.policy | 21 +++++++++++++++++++++ polkit-1/rules/90-set-brightness.rules | 9 +++++++++ 2 files changed, 30 insertions(+) create mode 100644 polkit-1/actions/com.sigexec.polkit.set-brightness.policy create mode 100644 polkit-1/rules/90-set-brightness.rules (limited to 'polkit-1') 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 @@ + + + + + Olivier Gayot + http://sigexec.com + + + Set the brightness of the monitor + Règle la luminosité de l'écran + + no + no + auth_admin_keep + + /usr/local/bin/brightness + set + + + 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; + } +}); -- cgit v1.2.3