The UPower service is available via the system message bus. To access the service, use the org.freedesktop.UPower interface on the /org/freedesktop/UPower object on the D-Bus system bus service with the well-known name org.freedesktop.UPower. $ dbus-send --print-reply \ --system \ --dest=org.freedesktop.UPower \ /org/freedesktop/UPower \ org.freedesktop.UPower.EnumerateDevices method return sender=:1.386 -> dest=:1.451 reply_serial=2 array [ object path "/org/freedesktop/UPower/devices/line_power_AC" object path "/org/freedesktop/UPower/devices/battery_BAT0" ] An array of object paths for devices. Enumerate all power objects on the system. Object path of device that was added. Emitted when a device is added. Object path of device that was removed. Emitted when a device is removed. Object path of device that was changed. Emitted when a device changed. Emitted when one or more properties on the object changes. This signal is sent when the session is about to be suspended or hibernated. This signal is DEPRECATED. Use NotifySleep() instead. This signal is sent when the session is about to be suspended or hibernated. Session and system programs have one second to do anything required before the sleep action is taken (such as sending out Avahi or Jabber messages). The sleep action type, e.g. suspend, hibernate or hybrid. This signal is sent when the session has just returned from Suspend() or Hibernate(). This signal is DEPRECATED. Use NotifyResume() instead. This signal is sent when the session has just returned from Suspend() or Hibernate(). Session and system programs can then do anything required (such as sending out Avahi or Jabber messages). The sleep action type, e.g. suspend, hibernate or hybrid. This method tells UPower that the Suspend() or Hibernate() method is about to be called. This allows UPower to emit the Suspending signal whilst session activities are happening that have to be done before the suspend process is started. This method would typically be called by the session power management daemon, before it locks the screen and waits for the screen to fade to black. The session power management component would then call Suspend() or Hibernate() when these syncronous tasks have completed. If this method is not called than nothing bad will happen and Suspend() or Hibernate() will block for the required second. The sleep action type, e.g. suspend or hibernate. Suspends the computer into a low power state. System state is not preserved if the power is lost. If AboutToRequestSleep() has not been called then UPower will send the Sleeping() signal and block for one second. If AboutToRequestSleep() has been called less than one second before this method is called then UPower will block for the remaining time to complete one second of delay. TRUE if allowed, otherwise FALSE Check if the caller has (or can get) the PolicyKit privilege to call Suspend. Hibernates the computer into a low power state. System state is preserved if the power is lost. If AboutToRequestSleep() has not been called then UPower will send the Sleeping() signal and block for one second. If AboutToRequestSleep() has been called less than one second before this method is called then UPower will block for the remaining time to complete one second of delay. TRUE if allowed, otherwise FALSE Check if the caller has (or can get) the PolicyKit privilege to call Hibernate. Version of the running daemon, e.g. 002. Whether the system is able to suspend. Whether the system is able to hibernate. Indicates whether the system is running on battery power. This property is provided for convenience. Indicates whether the system is running on battery power and if the battery is critically low. This property is provided for convenience. Indicates if the laptop lid is closed where the display cannot be seen. If the system has a lid device. If the system really has to sleep when the lid is closed. Some laptops actually melt (!) if the lid is closed and the computer keeps running. We blacklist those, and do something sane for the other machines. This allows us to set the default session policy to not suspend on lid close if the laptop is docked, and be sure the machine is not going to melt. If the system is currently docked. Note: the "is-docked" value is the result of a heuristic, which may involve testing the display output.