aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--files/usr/local/etc/polkit-1/rules.d/51-desktop.rules.desktop7
1 files changed, 7 insertions, 0 deletions
diff --git a/files/usr/local/etc/polkit-1/rules.d/51-desktop.rules.desktop b/files/usr/local/etc/polkit-1/rules.d/51-desktop.rules.desktop
index d57c4b9..5cab6db 100644
--- a/files/usr/local/etc/polkit-1/rules.d/51-desktop.rules.desktop
+++ b/files/usr/local/etc/polkit-1/rules.d/51-desktop.rules.desktop
@@ -1,4 +1,11 @@
polkit.addRule(function (action, subject) {
+$(if [ "${polkit_disable_suspend:-}" = true ]; then cat <<EOF
+ if (action.id == "org.freedesktop.consolekit.system.suspend" ||
+ action.id == "org.freedesktop.consolekit.system.hibernate") {
+ return polkit.Result.NO;
+ }
+EOF
+fi)
if ((action.id == "org.freedesktop.consolekit.system.restart" ||
action.id == "org.freedesktop.consolekit.system.stop" ||
action.id == "org.freedesktop.consolekit.system.suspend")