Events for power management sleep and resume

David Eriksson twogood at
Sat May 28 15:34:54 PDT 2005


For one of my projects I think it might be beneficial to get a
notification when the computer goes into sleep/suspend/hibernation, and
another notification when it later resumes from that state.

As I use both D-BUS and HAL already, I thought that maybe D-BUS signals
for these events would be nice. However, as the signals are asynchronous
a "sleep" signal might not be delivered until after resuming!

The actual details are somewhat distro-specific I think, but both for
APM and ACPI a script can be executed on these events. This script could
make D-BUS method calls that waited for a reply, before allowing the
computer to sleep.

Maybe my none-use of signals would be a suitable pattern for this? (I
have planned to elaborate on why I did like that, but I haven't, yet...)

Any ideas or comments?

               -\- David Eriksson -/-

        SynCE -
      ScummVM -
     Desquirr -

More information about the dbus mailing list