gi-gio-2.0.32: 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:

  • disable automatic downloads;
  • reduce the rate of refresh from online sources such as calendar or email synchronisation;
  • reduce the use of expensive visual effects.

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

newtype PowerProfileMonitor Source #

Memory-managed wrapper type.

Constructors

PowerProfileMonitor (ManagedPtr PowerProfileMonitor) 

Instances

Instances details
Eq PowerProfileMonitor Source # 
Instance details

Defined in GI.Gio.Interfaces.PowerProfileMonitor

GObject PowerProfileMonitor Source # 
Instance details

Defined in GI.Gio.Interfaces.PowerProfileMonitor

ManagedPtrNewtype PowerProfileMonitor Source # 
Instance details

Defined in GI.Gio.Interfaces.PowerProfileMonitor

TypedObject PowerProfileMonitor Source # 
Instance details

Defined in GI.Gio.Interfaces.PowerProfileMonitor

Methods

glibType :: IO GType

HasParentTypes PowerProfileMonitor Source # 
Instance details

Defined in GI.Gio.Interfaces.PowerProfileMonitor

IsGValue (Maybe PowerProfileMonitor) Source #

Convert PowerProfileMonitor to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gio.Interfaces.PowerProfileMonitor

type ParentTypes PowerProfileMonitor Source # 
Instance details

Defined in GI.Gio.Interfaces.PowerProfileMonitor

type ParentTypes PowerProfileMonitor = '[Initable, Object]

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