Table of Contents
This API is currently unstable and is likely to change in the future.
Power Manager exposes a DBUS API for programs to obtain information about the DPMS state and to change it if required.
The following constants are used to uniquely refer to the PowerManager object when making DBUS method calls:
DBUS Service: | org.gnome.PowerManager |
DBUS Object Path: | /org/gnome/PowerManager |
DBUS Interface: | org.gnome.PowerManager |
Since gnome-power-manager version 2.14.x the API has changed in the following way:
2.14.x method name | 2.15.x method name |
---|---|
CanSuspend | AllowedSuspend |
CanHibernate | AllowedHibernate |
InhibitInactiveSleep | Inhibit |
AllowInactiveSleep | UnInhibit |
getOnAc | GetOnAc |
getDpmsMode | GetDpmsMode |
setDpmsMode | SetDpmsMode |
(none) | Reboot |
(none) | AllowedShutdown |
(none) | AllowedReboot |
(none) | GetLowPowerMode |
These are the DBUS methods.
This call will attempt to suspend the system.
Direction | Type | Description |
---|---|---|
out | boolean | Success value |
This call will attempt to hibernate the system.
Direction | Type | Description |
---|---|---|
out | boolean | Success value |
This call will attempt to shutdown the system.
Direction | Type | Description |
---|---|---|
out | boolean | Success value |
If the current user in the session is able to suspend, and has permission to do so. This may fail if the admin has locked down the session.
Direction | Type | Description |
---|---|---|
out | boolean | If we are able to suspend |
If the current user in the session is able to hibernate, and has permission to do so. This may fail if the admin has locked down the session.
Direction | Type | Description |
---|---|---|
out | boolean | If we are able to hibernate |
If the current user in the session is able to shutdown, and has permission to do so. This may fail if the admin has locked down the session.
Direction | Type | Description |
---|---|---|
out | boolean | If we are able to shutdown |
If the current user in the session is able to reboot, and has permission to do so. This may fail if the admin has locked down the session.
Direction | Type | Description |
---|---|---|
out | boolean | If we are able to reboot |
DPMS is a standard from the VESA consortium for managing the power supply of monitors. This call requests a change in the state of DPMS for the current screen.
Direction | Type | Description |
---|---|---|
in | string | |
on | 100% power usage | |
standby | <50% power usage | |
suspend | <20% power usage | |
off | <5% power usage |
Returns the DPMS mode state.
Direction | Type | Description |
---|---|---|
out | string | |
on | 100% power usage | |
standby | <80% power usage | |
suspend | <30W power usage | |
off | <8W power usage |
Inhibits the computer from performing the idle sleep action. Useful if you want to do an operation of long duration without the computer suspending.
Direction | Type | Description |
---|---|---|
in | string | the application name, e.g. "nautilus" |
in | string | the localised reason to inhibit, e.g. "indexing files" |
out | unsigned integer | the cookie |
A cookie is a random UINT32 used to identify the inhibit.
Allows the computer to perform the idle sleep action. Applications that quit without calling this method will be automatically unregistered, but this is not recommended as the user may be warned.
Direction | Type | Description |
---|---|---|
in | unsigned integer | the cookie |
Finds out if the computer is on AC power, i.e. is not running on primary battery or UPS power.
Direction | Type | Description |
---|---|---|
out | boolean | If we are on AC power |
These are the DBUS signals.
Signals the value of the current DPMS state.
Direction | Type | Description |
---|---|---|
out | string | |
on | 100% power usage | |
standby | <80% power usage | |
suspend | <30W power usage | |
off | <8W power usage |