El Wed, Mar 18, 2009 at 04:00:50PM +0100, Christophe-Marie Duquesne ens deleit� 
amb les seg�ents paraules:
> ->"On the other hand, I think power status changes are announced
> through dbus, so this should still be doable without timers."
> If you have more informations about this, I would be glad if you
> shared it. I would like to improve my widgets and did not know that.

Sure! Here's an extract from 'dbus-monitor --session --monitor'

Plugging AC

    signal sender=:1.19 -> dest=(null destination) 
path=/org/freedesktop/PowerManagement; 
interface=org.freedesktop.PowerManagement; member=OnBatteryChanged
       boolean false
    signal sender=:1.19 -> dest=(null destination) 
path=/org/freedesktop/PowerManagement; 
interface=org.freedesktop.PowerManagement; member=PowerSaveStatusChanged
       boolean false

Unplugging AC

    signal sender=:1.19 -> dest=(null destination) 
path=/org/freedesktop/PowerManagement; 
interface=org.freedesktop.PowerManagement; member=OnBatteryChanged
       boolean true
    signal sender=:1.19 -> dest=(null destination) 
path=/org/freedesktop/PowerManagement; 
interface=org.freedesktop.PowerManagement; member=PowerSaveStatusChanged
       boolean true

The thing is that I've only found the specification in
http://people.freedesktop.org/~hughsient/temp/dbus-interface.html, so I'm not
sure whether this is standarized into freedesktop right now, or either it's a
proposal from GNOME.

Nevertheless, you'll still have to have some power-management-aware deamon
sitting around (I start most of the GNOME daemons with awesome) in order to get
those events posted in DBus.

OTOH, this comes for sure from a lower level notification layer, probably HAL
(present in Linux and FreeBSD), so you could probably post a DBus message (or
any other notification mechanism you like) triggered by a HAL event.

apa!

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth

-- 
To unsubscribe, send mail to [email protected].

Reply via email to