Xfce power manager does not suspend my laptop after inactivity

Hello! I’m using the latest Manjaro release, fully patched. Since the last two months my laptop has been having issues while triggering s2ram after some inactivity. Never had any issue before. I already tried downgrading the polkit package, which is the one I believe is the culprit, with no success. I also created a new polkit rule (see below) but this did not solve the issue. I’m not using any screensaver. System should go to sleep after 90m when plugged and 15m on battery. This is all I want.

These are the errors I get:

Apr 17 11:59:18 tpad1.home.arpa polkitd[537035]: Operator of unix-session:7 FAILED to authenticate to gain authorization for action org.freedesktop.login1.suspend for system-bus-name::1.2971 [/usr/bin/xfce4-power-manager] (owned by unix-user:superuser)
Apr 17 11:56:09 tpad1.home.arpa pkexec[566537]: superuser: Error executing command as another user: Not authorized [USER=root] [TTY=unknown] [CWD=/home/superuser] [COMMAND=/usr/bin/xfpm-power-backlight-helper --set-brightness 130]

This is the polkit I’ve created under /etc/polkit-1/rules.d:

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.login1.suspend" &&
        subject.isInGroup("unix-user:superuser")) {
        return polkit.Result.YES;
    }
});

I also played a little bit with ‘unix-user:superuser’ by setting ‘unix-group:power’ where my user belongs.

Any polkit expert here? Any suggestions?
Thanks!

Apr 17 11:59:18 tpad1.home.arpa polkitd[537035]: Operator of unix-session:7 FAILED to authenticate to gain authorization for action org.freedesktop.login1.suspend for system-bus-name::1.2971 [/usr/bin/xfce4-power-manager] (owned by unix-user:superuser)

Because the authentication failed for the named user I’d check whether that user is a member of the group(s) which are normally authorized.
I’d guess this to be the power and wheel groups.

groups will tell

In my very basic system without much modification this gives:

groups
sys network power lp wheel nachlese

but this is a VM and suspend does not work and is not useful there.

But I’m explicitly granting permissions to my user in the polkit rule:

 subject.isInGroup("unix-user:superuser")) {

I also tried the ‘power’ group where my user belongs to:

 subject.isInGroup("power")) {

None of these changes fixed the issue (after restarting the polkit service)…
I’ll check later if it possible to enable a verbose mode for polkit

I’m definitely not that expert! This is all I could come up with.
Someone else may be able to find the issue and help fixing it.

For the record, it seems so far that this configuration has solved my issue:

polkit.addRule(function(action, subject) {
    if (action.id == "org.freedesktop.login1.suspend" || action.id == "org.freedesktop.login1.suspend-multiple-session" &&
        subject.isInGroup("power")) {
        return polkit.Result.YES;
    }
});

Cheers!

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.