Power management in Xfce 4.10

Nick Schermer nickschermer at gmail.com
Sat Oct 29 15:15:43 CEST 2011


Folks,

I've looked into the shutdown mess we have right now and have the
following proposal to clean this up.

In the current situation both xfce4-session and xfce4-power-manager
have code to shutdown/reboot/etc though consolekit, upower and sudo.
Shutdown is a bit better implemented in xfce4-session because of the
fallback to sudo.

The initial idea was to move everything to xfce4-power-manager and let
xfce4-session make calls over d-bus, however not such a good idea. So
I suggest we make it work like below:

Xfce4-session
=============

1) Drop the Shutdown method in d-bus and replace it with 5 calls
(org.xfce.SessionManager): Shutdown (no args), CanShutdown (return
bool), Restart (no args), CanRestart (return bool), Logout (mode {0:
prompt, 1: no confirm}). Those are basically the same as the call in
consolkit, but xfce4-session also checks the non-consolekit modes:
sudo and /sbin/shutdown.

2) Remove suspend and hibernate all together from xfce4-session and
use xfce4-power-manager over d-bus for the logout dialog.

This way people without special power needs needs can still use Xfce
without power manager and it also gives xfce4-session full control
over session-saving; something that is not required for suspend and
hibernate.

Consolekit will be a virtual dependency for xfce4-session.

Unknown: Maybe we need session-save args in the calls. Need to check.


Xfce4-power-manager
===================

1) Remove the no longer supported org.freedesktop.PowerManagement
d-bus interface.

2) Extend org.xfce.Power.Manager with CanSuspend, Suspend,
CanHibernate, Hibernate, [some battery stuff]. This only needs upower,
possibly we can provide more fallbacks for non-linux os-es here.

3) Use xfce4-session over d-bus for shutdown actions, no d-bus
interface for shutdown and reboot.


Anybody opinions about this?

Nick


More information about the Xfce4-dev mailing list