When installing Gentoo with Xfce desktop environment it happens that Restart/Shutdown buttons are greyed when you are logged with a non-root user.
Searching many forums I found many "solutions" that didn't done the trick for me. But I also found the following article on Gentoo Forums: http://forums.gentoo.org/viewtopic-t-889144-start-0.html
By creating a file called /etc/polkit-1/localauthority/50-local.d/power.pkla with the following content:
[Local restart] Identity=unix-group:wheel Action=org.freedesktop.consolekit.system.restart ResultAny=yes ResultInactive=no ResultActive=yes [Local shutdown] Identity=unix-group:wheel Action=org.freedesktop.consolekit.system.stop ResultAny=yes ResultInactive=no ResultActive=yes [Local restart - multiple] Identity=unix-group:wheel Action=org.freedesktop.consolekit.system.restart-multiple-users ResultAny=yes ResultInactive=no ResultActive=yes [Local shutdown - multiple] Identity=unix-group:wheel Action=org.freedesktop.consolekit.system.stop-multiple-users ResultAny=yes ResultInactive=no ResultActive=yes
my Reboot/Shutdown buttons becomes instantly enabled and I was able from that point to restart/shutdown my system safely from desktop (instead from console with "sudo reboot" or something).
A second problem I have encountered was that suspend button shows an error message which said "not authorized". The problem is that we need to define a policy kit rule in the /etc/polkit-1/localauthority/50-local.d/upower.pkla file with the following content:
[Local Users] Identity=unix-group:power Action=org.freedesktop.upower.* ResultAny=yes ResultInactive=no ResultActive=yes
After that Suspend (to RAM) works like a charm.
Note: you can debug your system suspend/hibernate commands at a lower level by using the /sys/power/* files. Read more here.
Conclusion: first Xfce reboot shutdown suspend disabled now they are enabled ð
Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.
Eugen Mihailescu
Latest posts by Eugen Mihailescu (see all)
- Dual monitor setup in Xfce - January 9, 2019
- Gentoo AMD Ryzen stabilizator - April 29, 2018
- Symfony Compile Error Failed opening required Proxies - January 22, 2018
Thanks a lot ! You've save my life 😉
Thanks, this really made my day after toying around with policykit.
Argh, I also did quite a bit of searching on forums, now found your post — but it seems I have to continue my hunt for a solution... Your method didn't work for me.
Xfce is changing periodically and nonetheless the users (like you|me) have virtually infinite possible configurations, therefore the presented solution might work or not. So keep looking, I am absolutely sure somebody met the same symptom (like you) and hopefully he/she found a fix that might help.
Finally,
startxfce4 --with-ck-launch
instead of just startxfce4 solved the issue for me.