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 BatteryTechnology Source #

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.