[LAU] nosuspend - avoid computer suspend as long a app is running

Ralf Mardorf ralf.mardorf at alice-dsl.net
Sat Jul 1 08:30:09 UTC 2017


On Sat, 1 Jul 2017 09:22:05 +0200, Hermann Meyer wrote:
>Sure, you could switch of suspend at all, but maybe that's not what
>you wont.

Or you simply edit the polkit rules, as I did for power-off and reboot,
by just using the "org.freedesktop.login1.suspend" lines instead of the
org.freedesktop.login1.power-off and org.freedesktop.login1.reboot
lines.

[root at archlinux rocketmouse]# cat /etc/polkit-1/rules.d/10-admin-shutdown-reboot.rules 
polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.login1.power-off" ||
        action.id == "org.freedesktop.login1.power-off-ignore-inhibit" ||
        action.id == "org.freedesktop.login1.power-off-multiple-sessions" ||
        action.id == "org.freedesktop.login1.reboot" ||
        action.id == "org.freedesktop.login1.reboot-ignore-inhibit" ||
        action.id == "org.freedesktop.login1.reboot-multiple-sessions"
    ) {
        return polkit.Result.AUTH_SELF_KEEP;
    }
});

Regards,
Ralf

-- 
Vote for apulse!
echo $(w3m https://aur.archlinux.org/packages/apulse |grep 'Votes:    ')
Votes: 81                         Updated: Sat Jul  1 10:30:07 CEST 2017


More information about the Linux-audio-user mailing list