I did an pkg upgrade and some time afterwards , (when I wanted to reboot), I then noticed that the restart and shutdown options are now grayed out. from what I've looked up it is a not just me. I have yet to find the definite answer only the ability to check its status.
it does not say what file name to use. so I added it to this one in there but that is a do not edit file . file.
Code:
$ xfce4-power-manager --dump
---------------------------------------------------
Xfce power manager version 1.6.5
With policykit support
Without network manager support
---------------------------------------------------
Can suspend: True
Can hibernate: True
Authorized to suspend: False
Authorized to hibernate: False
Authorized to shutdown: False
Has battery: True
Has brightness panel: False
Has power button: True
Has hibernate button: False
Has sleep button: True
Has battery button: True
Has LID: True
Code:
$ 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;
}
});
Code:
// DO NOT EDIT THIS FILE, it will be overwritten on update
//
// Default rules for polkit
//
// See the polkit(8) man page for more information
// about configuring polkit.
polkit.addAdminRule(function(action, subject) {
return ["unix-group:wheel"];
});
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;
}
});
polkit.addRule(function (action, subject) {
if (action.id == "org.freedesktop.consolekit.system.suspend"
&& subject.isInGroup("operator")) {
return polkit.Result.YES;
}
});