taffybar-1.0.1: A desktop bar similar to xmobar, but with more GUI

Safe HaskellNone
LanguageHaskell2010

System.Information.Battery

Contents

Description

This is a simple library to query the Linux UPower daemon (via DBus) for battery information. Currently, it only retrieves information for the first battery it finds.

Synopsis

Types

data BatteryContext Source #

An opaque wrapper around some internal library state

data BatteryState Source #

data BatteryTechnology Source #

Instances
Enum BatteryTechnology Source # 
Instance details

Defined in System.Information.Battery

Eq BatteryTechnology Source # 
Instance details

Defined in System.Information.Battery

Ord BatteryTechnology Source # 
Instance details

Defined in System.Information.Battery

Show BatteryTechnology Source # 
Instance details

Defined in System.Information.Battery

Accessors

batteryContextsNew :: IO [BatteryContext] Source #

Construct a battery context for every battery in the system. This could fail if the UPower daemon is not running. The contexts can be used to get actual battery state with getBatteryInfo.

getBatteryInfo :: BatteryContext -> IO (Maybe BatteryInfo) Source #

Query the UPower daemon about information on a specific battery. If some fields are not actually present, they may have bogus values here. Don't bet anything critical on it.