Copyright | (c) Ivan A. Malison |
---|---|
License | BSD3-style (see LICENSE) |
Maintainer | Ivan A. Malison |
Stability | unstable |
Portability | unportable |
Safe Haskell | None |
Language | Haskell2010 |
This module provides battery widgets using the UPower system service.
Currently it reports only the first battery it finds. If it does not find a battery, it just returns an obnoxious widget with warning text in it. Battery hotplugging is not supported. These more advanced features could be supported if there is interest.
- batteryBarNew :: MonadIO m => BarConfig -> Double -> m Widget
- batteryBarNewWithFormat :: MonadIO m => BarConfig -> String -> Double -> m Widget
- textBatteryNew :: [IORef BatteryContext] -> String -> Double -> IO Widget
- defaultBatteryConfig :: BarConfig
Documentation
batteryBarNew :: MonadIO m => BarConfig -> Double -> m Widget Source #
A fancy graphical battery widget that represents batteries as colored vertical bars (one per battery). There is also a textual percentage reppadout next to the bars, containing a summary of battery information.
batteryBarNewWithFormat :: MonadIO m => BarConfig -> String -> Double -> m Widget Source #
A battery bar constructor which allows using a custom format string in order to display more information, such as charging/discharging time and status. An example: "$percentage$% ($time$) - $status$".
:: [IORef BatteryContext] | |
-> String | Display format |
-> Double | Poll period in seconds |
-> IO Widget |
defaultBatteryConfig :: BarConfig Source #
A default configuration for the graphical battery display. The bar will be red when power is critical (< 10%), green if it is full (> 90%), and grey otherwise.
You can customize this with any of the options in BarConfig