taffybar-0.4.6: 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

Accessors

batteryContextNew :: IO (Maybe BatteryContext) Source

Construct a battery context if possible. This could fail if the UPower daemon is not running. The context 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.