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.
13 lines
561 B
Plaintext
13 lines
561 B
Plaintext
// 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;
|
|
}
|
|
});
|