gi-gio-2.0.29: Gio bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gio.Interfaces.PowerProfileMonitor

Description

PowerProfileMonitor makes it possible for applications as well as OS components to monitor system power profiles and act upon them. It currently only exports whether the system is in “Power Saver” mode (known as “Low Power” mode on some systems).

When in “Low Power” mode, it is recommended that applications:

  • disabling automatic downloads
  • reduce the rate of refresh from online sources such as calendar or email synchronisation
  • if the application has expensive visual effects, reduce them

It is also likely that OS components providing services to applications will lower their own background activity, for the sake of the system.

There are a variety of tools that exist for power consumption analysis, but those usually depend on the OS and hardware used. On Linux, one could use upower to monitor the battery discharge rate, powertop to check on the background activity or activity at all), sysprof to inspect CPU usage, and intel_gpu_time to profile GPU usage.

Don't forget to disconnect the PowerProfileMonitor::notifypowerSaverEnabled signal, and unref the PowerProfileMonitor itself when exiting.

Since: 2.70

Synopsis

Exported types

class (GObject o, IsDescendantOf PowerProfileMonitor o) => IsPowerProfileMonitor o Source #

Type class for types which can be safely cast to PowerProfileMonitor, for instance with toPowerProfileMonitor.

Instances

Instances details
(GObject o, IsDescendantOf PowerProfileMonitor o) => IsPowerProfileMonitor o Source # 
Instance details

Defined in GI.Gio.Interfaces.PowerProfileMonitor

toPowerProfileMonitor :: (MonadIO m, IsPowerProfileMonitor o) => o -> m PowerProfileMonitor Source #

Cast to PowerProfileMonitor, for types for which this is known to be safe. For general casts, use castTo.

Methods

dupDefault

powerProfileMonitorDupDefault Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m PowerProfileMonitor

Returns: a new reference to the default PowerProfileMonitor

Gets a reference to the default PowerProfileMonitor for the system.

Since: 2.70

getPowerSaverEnabled

powerProfileMonitorGetPowerSaverEnabled Source #

Arguments

:: (HasCallStack, MonadIO m, IsPowerProfileMonitor a) 
=> a

monitor: a PowerProfileMonitor

-> m Bool

Returns: Whether the system is in “Power Saver” mode.

Gets whether the system is in “Power Saver” mode.

You are expected to listen to the PowerProfileMonitor::notifypowerSaverEnabled signal to know when the profile has changed.

Since: 2.70

Properties

powerSaverEnabled

Whether “Power Saver” mode is enabled on the system.

Since: 2.70

getPowerProfileMonitorPowerSaverEnabled :: (MonadIO m, IsPowerProfileMonitor o) => o -> m Bool Source #

Get the value of the “power-saver-enabled” property. When overloading is enabled, this is equivalent to

get powerProfileMonitor #powerSaverEnabled