fix: add polkit rule to allow greeter user to reboot and shutdown

The greetd greeter session is inactive in logind, so polkit defaults
require admin authentication for power actions. This rule grants the
greeter user permission for reboot and power-off without authentication.
This commit is contained in:
nevaforget 2026-04-15 14:23:49 +02:00
parent 324dda0548
commit fcac91b540

View File

@ -0,0 +1,12 @@
// ABOUTME: Allow the greeter user to reboot and power off without authentication.
// ABOUTME: Required because greetd's greeter session is inactive in logind.
polkit.addRule(function(action, subject) {
if (subject.user === "greeter" &&
(action.id === "org.freedesktop.login1.reboot" ||
action.id === "org.freedesktop.login1.reboot-multiple-sessions" ||
action.id === "org.freedesktop.login1.power-off" ||
action.id === "org.freedesktop.login1.power-off-multiple-sessions")) {
return polkit.Result.YES;
}
});