Xfce Xfce logout menu lack of "suspend" , "hibernate" menu

normal user "sam" logout menu incomplete, no "Suspend" option.
"Restart" and "Shut Down" button is in gray.
How can I get my logout full functional menu back ?
root user have no such problem.
installed on Thinkpad X220 Xfce 4.14+slim+xf86-video-Intel
Screenshot_2020-04-02_06-41-06.png

use xfce4-screenshooter-plugin "PrtSc" button delay 10 seconds to captured.
 
If I recall correctly, just adding your user to the operator group should be enough.

# pw groupmod operator -m sam
 
how to config this /usr/local/etc/polkit-1/rules.d/50-default.rules

to enable logout/reboot/suspend GUI current code is

polkit.addAdminRule(function(action, subject) {
return ["unix-group:wheel"];
});
 
The pkg-message of xfce4-session ( pkg info -D xfce4-session) :

xfce4-session-4.14.0_1:
On install:
To be able to shutdown or reboot your system, you'll have to add .rules
files in /usr/local/etc/polkit-1/rules.d directory. Which looks
like this (replace PUTYOURGROUPHERE by your group):

polkit.addRule(function (action, subject) {
if ((action.id == "org.freedesktop.consolekit.system.restart" ||
action.id == "org.freedesktop.consolekit.system.stop")
&& subject.isInGroup("PUTYOURGROUPHERE")) {
return polkit.Result.YES;
}
});

For those who have working suspend/resume:

polkit.addRule(function (action, subject) {
if (action.id == "org.freedesktop.consolekit.system.suspend"
&& subject.isInGroup("PUTYOURGROUPHERE")) {
return polkit.Result.YES;
}
});
...
 
How do you start Xorg / Xfce? If you start it with startxfce4 your logout menu will have Restart and Shutdown greyed out...
 
I start with input username and password in slim (SLiM - Simple Login Manager)
and put
"exec xfce4-session" in .xinitrc
 
First don't edit 50-default.rules it will be overwritten on update. Create your own rules file:
sudo vim usr/local/etc/polkit-1/rules.d/85-suspend.rules
Code:
polkit.addRule(function (action, subject) {
  if ((action.id == "org.freedesktop.consolekit.system.restart" ||
      action.id == "org.freedesktop.consolekit.system.stop")
      && subject.isInGroup("operator")) {
    return polkit.Result.YES;
  }
});

// For those who have working suspend/resume:

polkit.addRule(function (action, subject) {
  if (action.id == "org.freedesktop.consolekit.system.suspend"
      && subject.isInGroup("operator")) {
    return polkit.Result.YES;
  }
});

// Explicitly disallow hibernation because it's not supported by the OS.

polkit.addRule(function (action, subject) {
  if (action.id == "org.freedesktop.consolekit.system.hibernate") {
    return polkit.Result.NO;
  }
});
 
sudo vim /usr/local/etc/polkit-1/rules.d/85-suspend.rules (what is "85" stand for ?)
Copy Minbari's code and : "+p to paste
 
I couldn't get Minbari's solution to work.

It might help a bit, if there was a clarification as to what's meant to be achieved with it. So someone like me could troubleshoot.

Some info:
Code:
xfce4-power-manager --dump
---------------------------------------------------
       Xfce power manager version 4.16.0
With policykit support
Without network manager support
---------------------------------------------------
Can suspend: False
Can hibernate: False
Authorized to suspend: True
Authorized to hibernate: True
Authorized to shutdown: False
Has battery: False
Has brightness panel: False
Has power button: True
Has hibernate button: True
Has sleep button: True
Has battery button: True
Has LID: False

However, suspending works by typing
Code:
acpiconf -s 3
as given here:

 
Back
Top