monky-2.1.0.0: A system state collecting library and application

PortabilityLinux
Stabilitytesting
Maintainerongy
Safe HaskellSafe-Inferred

Monky.Battery

Description

This module allows to read information about a battery connected to the system.

This module does not support every setup yet. The files in sys used by this module are driver dependend. If it crashes monky for you setup please make a bug report with an `ls sysclasspower_supply ++ e ++ /` attached.

Synopsis

Documentation

getBatteryHandleSource

Arguments

:: String

The name of the wall socket adapter used by the battery

-> String

The name of the battery

-> IO BatteryHandle 

Create a BatteryHandle

getBatteryHandle' :: String -> IO BatteryHandleSource

Version which defaults to BAT0

getCurrentStatus :: BatteryHandle -> IO BatteryStateSource

Get the current state of the battery (loadingdrainingfull)

getCurrentLevel :: BatteryHandle -> IO IntSource

Get the charge left in the battery in percent.

data BatteryHandle Source

The handle exported by this module

getTimeLeft :: BatteryHandle -> IO IntSource

Get an approximated amount of seconds left until the battery runs out

getLoading :: BatteryHandle -> IO FloatSource

Get current loading speed in Watt/s

data BatteryState Source

Datatype to represent battery state