org.freedesktop.DeviceKit.Power

org.freedesktop.DeviceKit.Power — Power interface

Methods

EnumerateDevices (out 'ao' devices)
Suspend          ()
Hibernate        ()

Signals

DeviceAdded   ('o' device)
DeviceRemoved ('o' device)
DeviceChanged ('o' device)
Changed       ()

Implemented Interfaces

Objects implementing org.freedesktop.DeviceKit.Power also implements org.freedesktop.DBus.Introspectable, org.freedesktop.DBus.Properties

Properties

'DaemonVersion' read      's'
'CanSuspend'    read      'b'
'CanHibernate'  read      'b'
'OnBattery'     read      'b'
'OnLowBattery'  read      'b'
'LidIsClosed'   read      'b'
'LidIsPresent'  read      'b'

Description

The DeviceKit-power service is available via the system message bus. To access the service, use the org.freedesktop.DeviceKit.Power interface on the /org/freedesktop/DeviceKit/Power object on the D-Bus system bus service with the well-known name org.freedesktop.DeviceKit.Power.

$ dbus-send --print-reply \
            --system \
            --dest=org.freedesktop.DeviceKit.Power \
            /org/freedesktop/DeviceKit/Power \
            org.freedesktop.DeviceKit.Power.EnumerateDevices

method return sender=:1.386 -> dest=:1.451 reply_serial=2
   array [
      object path "/org/freedesktop/DeviceKit/Power/devices/line_power_AC"
      object path "/org/freedesktop/DeviceKit/Power/devices/battery_BAT0"
   ]
            

Details

EnumerateDevices ()

EnumerateDevices (out 'ao' devices)

Enumerate all power objects on the system.

devices:

An array of object paths for devices.

Suspend ()

Suspend ()

Suspends the computer into a low power state. System state is not preserved if the power is lost.


Hibernate ()

Hibernate ()

Hibernates the computer into a low power state. System state is preserved if the power is lost.

Signal Details

The DeviceAdded signal

DeviceAdded ('o' device)

Emitted when a device is added.

device:

Object path of device that was added.

The DeviceRemoved signal

DeviceRemoved ('o' device)

Emitted when a device is removed.

device:

Object path of device that was removed.

The DeviceChanged signal

DeviceChanged ('o' device)

Emitted when a device changed.

device:

Object path of device that was changed.

The Changed signal

Changed ()

Emitted when one or more properties on the object changes.

Property Details

The "DaemonVersion" property

'DaemonVersion'  read      's'

Version of the running daemon, e.g. 002.


The "CanSuspend" property

'CanSuspend'  read      'b'

Whether the system is able to suspend.


The "CanHibernate" property

'CanHibernate'  read      'b'

Whether the system is able to hibernate.


The "OnBattery" property

'OnBattery'  read      'b'

Indicates whether the system is running on battery power. This property is provided for convenience.


The "OnLowBattery" property

'OnLowBattery'  read      'b'

Indicates whether the system is running on battery power and if the battery is critically low. This property is provided for convenience.


The "LidIsClosed" property

'LidIsClosed'  read      'b'

Indicates if the laptop lid is closed where the display cannot be seen.


The "LidIsPresent" property

'LidIsPresent'  read      'b'

If the system has a lid device.