A QML import from PowerDevil/Solid PM should be provided which exposes access to brightness handling, inhibition, AC adapter and various other PM related things.

import org.kde.solid.powermanagement 1.0

Solid.Power {
  id: powermanagement

Other things that might be useful but not directly inside the scope of PowerDevil is toggling (or at least querying the state of) Bluetooth, Wireless, Flight Mode.

Screen and keyboard brightness handling

screenBrightnessAvailable (bool, readonly)

Whether the computer has screen brightness controls available, so the battery monitor can not show the brightness slider in this case.

maxScreenBrightness (int, readonly)

The maximum screen brightness value (such as 4200) the device reports

screenBrightness (int)

For getting and setting the desired screen brightness.

There should also be a way to change screen brightness without triggering the OSD, eg. in battery monitor moving the slider you are actively manipulating the brightness (with visual feedback through the slider) hence no need for an OSD. Maybe an invokable setScreenBrightnessSilently(int) or a property screenBrightnessFeedbackEnabled or so. (Same for keyboard brightness)

keyboardBrightnessAvailable (bool, readonly)

Whether the computer has keyboard brightness controls available. The heuristics are way less complicated as there is a standardized upower DBus interface for this. If it is not available, the computer doesn't have keyboard brightness.

maxKeyboardBrightness (int, readonly)

The maximum keyboard brightness value (such as 4 or 10) the device reports. Since keyboard lights are usually less fine-grained a fixed 0-100% (like in 10% steps) is not suitable

keyboardBrightness (int)

For getting and setting the desired keyboard brightness.

Inhibition handling

The way the FDO inhibition interface works is that you call inhibit with your application name and a reason and receive a "cookie" which is used if you want to remove inhibition again. Of course it would be super-cool if we could make this transparent to the user and just allow him to call inhibit(reason) and uninhibit without having to manually deal with the cookie thing.

var cookie = inhibit(application, reason)

Start inhibition. The value returned is needed for removing inhibition again later.


Remove inhibition

inhibited (bool, readonly)

If there is currently any inhibition going on system-wide

AC Adapter

pluggedIn(bool, readonly)

If the AC adapter is currently plugged in. This is independent of the chargeState property of a battery.

acAdapterEnergyRate(float, readonly)

This is not directly available through upower but might be used from the energyRate of a battery that is being charged so we could warn the user if the AC adapter is broken (??)



suspendToRamSupported (bool, readonly)

Whether the device supports suspend to ram (and the app/user is allowed to?)



Whether the device supports suspend to disk (and the app/user is allowed to?)



Whether the device supports hybrid suspend (and the app/user is allowed to?)

Various other stuff

These are other convenience methods that are wildly implemented on the clientside (login manager, battery monitor, etc) and could/should be moved to the library

batteryRemainingTime (qulonglong, readlonly)

The overall battery remaining time for all batteries combined (read: how long will my computer last now?)

batteryCumulativePercent (float, readonly)

The average percentage of all power supply batteries combined

batteryCumulativePresent (bool, readonly)

(Used by the battery monitor and not that useful I guess?) Are all the battery slots available actually taken (there can be empty slots of removable batteries)

batteryCumulativeCharged (bool, readonly)

Are all the batteries available fully charged?

hasLid (bool, readonly)

Whether the computer has a lid (is a notebook), so Kickoff can show the laptop icon for the "Computer" category again ;)

This page was last edited on 15 June 2014, at 16:13. Content is available under Creative Commons License SA 4.0 unless otherwise noted.