-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A desktop bar similar to xmobar, but with more GUI
--   
--   A somewhat fancier desktop bar than xmobar. This bar is based on
--   gtk2hs and provides several widgets (including a few graphical ones).
--   It also sports an optional snazzy system tray.
--   
--   Changes in v0.2.1:
--   
--   <ul>
--   <li>More robust strut handling for multiple monitors of different
--   sizes (contributed by Morgan Gibson)</li>
--   <li>New widgets from Jose' A. Romero (network monitor, fs monitor,
--   another CPU monitor)</li>
--   <li>Allow the bar widget to grow vertically (also contributed by Jose'
--   A. Romero)</li>
--   </ul>
--   
--   Changes in v0.2.0:
--   
--   <ul>
--   <li>Add some more flexible formatting options for the XMonadLog widget
--   (contributed by cnervi).</li>
--   <li>Make the PollingLabel more robust with an exception handler for
--   IOExceptions</li>
--   <li>Added more documentation for a few widgets</li>
--   </ul>
--   
--   Changes in v0.1.3:
--   
--   <ul>
--   <li>Depend on gtk 0.12.1+ to be able to build under ghc 7.2</li>
--   <li>Fix the background colors in the calendar so that it follows the
--   GTK theme instead of the bar-specific color settings</li>
--   <li>Fix the display of non-ASCII window titles in the XMonad log
--   applet (assuming you use the dbusLog function)</li>
--   <li>Add a horrible hack to force the bar to not resize to be larger
--   than the screen due to notifications or long window titles</li>
--   </ul>
--   
--   Changes in v0.1.2:
--   
--   <ul>
--   <li>Readable widget for freedesktop notifications</li>
--   <li>Fixed a few potential deadlocks on startup</li>
--   <li>Use the GTK+ rc-file styling system for colors instead of hard
--   coding them</li>
--   </ul>
@package taffybar
@version 0.2.1

module System.Information.CPU

-- | Return a pair with (user time, system time, total time) (read from
--   <i>proc</i>stat). The function waits for 50 ms between samples.
cpuLoad :: IO (Double, Double, Double)

module System.Information.Memory
data MemoryInfo
MemoryInfo :: Double -> Double -> Double -> Double -> Double -> Double -> Double -> MemoryInfo
memoryUsedRatio :: MemoryInfo -> Double
memoryTotal :: MemoryInfo -> Double
memoryFree :: MemoryInfo -> Double
memoryBuffer :: MemoryInfo -> Double
memoryCache :: MemoryInfo -> Double
memoryRest :: MemoryInfo -> Double
memoryUsed :: MemoryInfo -> Double
parseMeminfo :: IO MemoryInfo


-- | A vertical bar that can plot data in the range [0, 1]. The colors are
--   configurable.
module System.Taffybar.Widgets.VerticalBar
data VerticalBarHandle
data BarConfig
BarConfig :: (Double, Double, Double) -> (Double, Double, Double) -> (Double -> (Double, Double, Double)) -> Int -> Int -> BarDirection -> BarConfig

-- | Color of the border drawn around the widget
barBorderColor :: BarConfig -> (Double, Double, Double)

-- | The background color of the widget
barBackgroundColor :: BarConfig -> (Double, Double, Double)

-- | A function to determine the color of the widget for the current data
--   point
barColor :: BarConfig -> Double -> (Double, Double, Double)

-- | Number of pixels of padding around the widget
barPadding :: BarConfig -> Int
barWidth :: BarConfig -> Int
barDirection :: BarConfig -> BarDirection
data BarDirection
HORIZONTAL :: BarDirection
VERTICAL :: BarDirection
verticalBarNew :: BarConfig -> IO (Widget, VerticalBarHandle)
verticalBarSetPercent :: VerticalBarHandle -> Double -> IO ()

-- | A default bar configuration. The color of the active portion of the
--   bar must be specified.
defaultBarConfig :: (Double -> (Double, Double, Double)) -> BarConfig


-- | This is a graph widget inspired by the widget of the same name in
--   Awesome (the window manager). It plots a series of data points
--   similarly to a bar graph. This version must be explicitly fed data
--   with <a>graphAddSample</a>. For a more automated version, see
--   <tt>PollingGraph</tt>.
--   
--   Like Awesome, this graph can plot multiple data sets in one widget.
--   The data sets are plotted in the order provided by the caller.
--   
--   Note: all of the data fed to this widget should be in the range [0,1].
module System.Taffybar.Widgets.Graph
data GraphHandle

-- | The configuration options for the graph. The padding is the number of
--   pixels reserved as blank space around the widget in each direction.
data GraphConfig
GraphConfig :: Int -> (Double, Double, Double) -> (Double, Double, Double) -> [(Double, Double, Double, Double)] -> Int -> Maybe String -> Int -> GraphConfig

-- | Number of pixels of padding on each side of the graph widget
graphPadding :: GraphConfig -> Int

-- | The background color of the graph (default black)
graphBackgroundColor :: GraphConfig -> (Double, Double, Double)

-- | The border color drawn around the graph (default gray)
graphBorderColor :: GraphConfig -> (Double, Double, Double)

-- | Colors for each data set (default [])
graphDataColors :: GraphConfig -> [(Double, Double, Double, Double)]

-- | The number of data points to retain for each data set (default 20)
graphHistorySize :: GraphConfig -> Int

-- | May contain Pango markup (default Nothing)
graphLabel :: GraphConfig -> Maybe String

-- | The width (in pixels) of the graph widget (default 50)
graphWidth :: GraphConfig -> Int
graphNew :: GraphConfig -> IO (Widget, GraphHandle)

-- | Add a data point to the graph for each of the tracked data sets. There
--   should be as many values in the list as there are data sets.
graphAddSample :: GraphHandle -> [Double] -> IO ()
defaultGraphConfig :: GraphConfig


-- | A variant of the Graph widget that automatically updates itself with a
--   callback at a fixed interval.
module System.Taffybar.Widgets.PollingGraph
data GraphHandle

-- | The configuration options for the graph. The padding is the number of
--   pixels reserved as blank space around the widget in each direction.
data GraphConfig
GraphConfig :: Int -> (Double, Double, Double) -> (Double, Double, Double) -> [(Double, Double, Double, Double)] -> Int -> Maybe String -> Int -> GraphConfig

-- | Number of pixels of padding on each side of the graph widget
graphPadding :: GraphConfig -> Int

-- | The background color of the graph (default black)
graphBackgroundColor :: GraphConfig -> (Double, Double, Double)

-- | The border color drawn around the graph (default gray)
graphBorderColor :: GraphConfig -> (Double, Double, Double)

-- | Colors for each data set (default [])
graphDataColors :: GraphConfig -> [(Double, Double, Double, Double)]

-- | The number of data points to retain for each data set (default 20)
graphHistorySize :: GraphConfig -> Int

-- | May contain Pango markup (default Nothing)
graphLabel :: GraphConfig -> Maybe String

-- | The width (in pixels) of the graph widget (default 50)
graphWidth :: GraphConfig -> Int
pollingGraphNew :: GraphConfig -> Double -> IO [Double] -> IO Widget
defaultGraphConfig :: GraphConfig


-- | Generic code to poll any of the many data files maintained by the
--   kernel in POSIX systems. Provides methods for applying a custom
--   parsing function to the contents of the file and to calculate
--   differentials across one or more values provided via the file.
module System.Information.StreamInfo

-- | Apply the given parser function to the file under the given path to
--   produce a lookup map, then use the given selector as key to extract
--   from it the desired value.
getParsedInfo :: FilePath -> (String -> [(String, [Integer])]) -> String -> IO [Integer]

-- | Probe the given action and return the relative variation of each of
--   the obtained values against the whole, where the whole is calculated
--   as the sum of all the values in the probe.
getLoad :: Double -> IO [Integer] -> IO [Double]

-- | Probe the given action and, interpreting the result as a variation in
--   time, return the speed of change of its values.
getTransfer :: Double -> IO [Integer] -> IO [Double]

module System.Information.CPU2
getCPULoad :: String -> IO [Double]

module System.Information.Network
getNetInfo :: String -> IO [Integer]


-- | Like the vertical bar, but this widget automatically updates itself
--   with a callback at fixed intervals.
module System.Taffybar.Widgets.PollingBar
data VerticalBarHandle
data BarConfig
BarConfig :: (Double, Double, Double) -> (Double, Double, Double) -> (Double -> (Double, Double, Double)) -> Int -> Int -> BarDirection -> BarConfig

-- | Color of the border drawn around the widget
barBorderColor :: BarConfig -> (Double, Double, Double)

-- | The background color of the widget
barBackgroundColor :: BarConfig -> (Double, Double, Double)

-- | A function to determine the color of the widget for the current data
--   point
barColor :: BarConfig -> Double -> (Double, Double, Double)

-- | Number of pixels of padding around the widget
barPadding :: BarConfig -> Int
barWidth :: BarConfig -> Int
barDirection :: BarConfig -> BarDirection
data BarDirection
HORIZONTAL :: BarDirection
VERTICAL :: BarDirection
pollingBarNew :: BarConfig -> Double -> IO Double -> IO Widget

-- | A default bar configuration. The color of the active portion of the
--   bar must be specified.
defaultBarConfig :: (Double -> (Double, Double, Double)) -> BarConfig


-- | 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.
module System.Information.Battery

-- | An opaque wrapper around some internal library state
data BatteryContext

-- | There are a few fields supported by UPower that aren't exposed here..
--   could be easily.
data BatteryInfo
BatteryInfo :: Text -> Text -> Text -> Text -> BatteryType -> Bool -> Bool -> Bool -> Bool -> Double -> Double -> Double -> Double -> Double -> Double -> Int64 -> Int64 -> Double -> Bool -> BatteryState -> Bool -> Double -> BatteryTechnology -> BatteryInfo
batteryNativePath :: BatteryInfo -> Text
batteryVendor :: BatteryInfo -> Text
batteryModel :: BatteryInfo -> Text
batterySerial :: BatteryInfo -> Text
batteryType :: BatteryInfo -> BatteryType
batteryPowerSupply :: BatteryInfo -> Bool
batteryHasHistory :: BatteryInfo -> Bool
batteryHasStatistics :: BatteryInfo -> Bool
batteryOnline :: BatteryInfo -> Bool
batteryEnergy :: BatteryInfo -> Double
batteryEnergyEmpty :: BatteryInfo -> Double
batteryEnergyFull :: BatteryInfo -> Double
batteryEnergyFullDesign :: BatteryInfo -> Double
batteryEnergyRate :: BatteryInfo -> Double
batteryVoltage :: BatteryInfo -> Double
batteryTimeToEmpty :: BatteryInfo -> Int64
batteryTimeToFull :: BatteryInfo -> Int64
batteryPercentage :: BatteryInfo -> Double
batteryIsPresent :: BatteryInfo -> Bool
batteryState :: BatteryInfo -> BatteryState
batteryIsRechargable :: BatteryInfo -> Bool
batteryCapacity :: BatteryInfo -> Double
batteryTechnology :: BatteryInfo -> BatteryTechnology
data BatteryState
BatteryStateUnknown :: BatteryState
BatteryStateCharging :: BatteryState
BatteryStateDischarging :: BatteryState
BatteryStateEmpty :: BatteryState
BatteryStateFullyCharged :: BatteryState
BatteryStatePendingCharge :: BatteryState
BatteryStatePendingDischarge :: BatteryState
data BatteryTechnology
BatteryTechnologyUnknown :: BatteryTechnology
BatteryTechnologyLithiumIon :: BatteryTechnology
BatteryTechnologyLithiumPolymer :: BatteryTechnology
BatteryTechnologyLithiumIronPhosphate :: BatteryTechnology
BatteryTechnologyLeadAcid :: BatteryTechnology
BatteryTechnologyNickelCadmium :: BatteryTechnology
BatteryTechnologyNickelMetalHydride :: BatteryTechnology
data BatteryType
BatteryTypeUnknown :: BatteryType
BatteryTypeLinePower :: BatteryType
BatteryTypeBatteryType :: BatteryType
BatteryTypeUps :: BatteryType
BatteryTypeMonitor :: BatteryType
BatteryTypeMouse :: BatteryType
BatteryTypeKeyboard :: BatteryType
BatteryTypePda :: BatteryType
BatteryTypePhone :: BatteryType

-- | 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 <a>getBatteryInfo</a>.
batteryContextNew :: IO (Maybe BatteryContext)

-- | 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.
getBatteryInfo :: BatteryContext -> IO BatteryInfo
instance Show BatteryType
instance Ord BatteryType
instance Eq BatteryType
instance Enum BatteryType
instance Show BatteryState
instance Ord BatteryState
instance Eq BatteryState
instance Enum BatteryState
instance Show BatteryTechnology
instance Ord BatteryTechnology
instance Eq BatteryTechnology
instance Enum BatteryTechnology


-- | This is a <a>Now Playing</a>-style widget that listens for MPRIS
--   events on DBus. Various media players implement this. This widget only
--   works with version 1 of the MPRIS protocol
--   (http:<i></i>www.mpris.org<i>1.0</i>spec.html). Support for version 2
--   will be in a separate widget.
--   
--   This widget isn't as configurable as the others yet - that will be
--   fixed.
module System.Taffybar.MPRIS
mprisNew :: IO Widget


-- | This widget listens on DBus for freedesktop notifications
--   (http:<i></i>developer.gnome.org<i>notification-spec</i>). Currently
--   it is somewhat ugly, but the format is somewhat configurable. A visual
--   overhaul of the widget is coming.
--   
--   The widget only displays one notification at a time and notifications
--   are cancellable.
module System.Taffybar.FreedesktopNotifications

-- | A simple structure representing a Freedesktop notification
data Notification
Notification :: Text -> Word32 -> Text -> Text -> Int32 -> Word32 -> Notification
noteAppName :: Notification -> Text
noteReplaceId :: Notification -> Word32
noteSummary :: Notification -> Text
noteBody :: Notification -> Text
noteExpireTimeout :: Notification -> Int32
noteId :: Notification -> Word32
data NotificationConfig
NotificationConfig :: Int -> Int -> (Notification -> String) -> NotificationConfig

-- | Maximum time that a notification will be displayed (in seconds).
--   Default: 10
notificationMaxTimeout :: NotificationConfig -> Int

-- | Maximum length displayed, in characters. Default: 50
notificationMaxLength :: NotificationConfig -> Int

-- | Function used to format notifications
notificationFormatter :: NotificationConfig -> Notification -> String

-- | Create a new notification area with the given configuration.
notifyAreaNew :: NotificationConfig -> IO Widget

-- | The default formatter is one of
--   
--   <ul>
--   <li>Summary : Body</li>
--   <li>Summary</li>
--   </ul>
--   
--   depending on the presence of a notification body.
defaultNotificationConfig :: NotificationConfig
instance Show Notification
instance Eq Notification


-- | This is a simple text widget that updates its contents by calling a
--   callback at a set interval.
module System.Taffybar.Widgets.PollingLabel

-- | Create a new widget that updates itself at regular intervals. The
--   function
--   
--   <pre>
--   pollingLabelNew initialString cmd interval
--   </pre>
--   
--   returns a widget with initial text <tt>initialString</tt>. The widget
--   forks a thread to update its contents every <tt>interval</tt> seconds.
--   The command should return a string with any HTML entities escaped.
--   This is not checked by the function, since Pango markup shouldn't be
--   escaped. Proper input sanitization is up to the caller.
--   
--   If the IO action throws an exception, it will be swallowed and the
--   label will not update until the update interval expires.
pollingLabelNew :: String -> Double -> IO String -> IO Widget


-- | This module defines a simple textual weather widget that polls NOAA
--   for weather data. To find your weather station, you can use
--   
--   <pre>
--   http://lwf.ncdc.noaa.gov/oa/climate/stationlocator.html
--   </pre>
--   
--   For example, Madison, WI is KMSN.
--   
--   NOAA provides several pieces of information in each request; you can
--   control which pieces end up in your weather widget by providing a
--   _template_ that is filled in with the current information. The
--   template is just a <a>String</a> with variables between dollar signs.
--   The variables will be substituted with real data by the widget.
--   Example:
--   
--   <pre>
--   let wcfg = (defaultWeatherConfig "KMSN") { weatherTemplate = "$tempC$ C @ $humidity$" }
--       weatherWidget = weatherNew wcfg 10
--   </pre>
--   
--   This example makes a new weather widget that checks the weather at
--   KMSN (Madison, WI) every 10 minutes, and displays the results in
--   Celcius.
--   
--   Available variables:
--   
--   <ul>
--   <li><i><tt>stationPlace</tt></i> The name of the weather station</li>
--   <li><i><tt>stationState</tt></i> The state that the weather station is
--   in</li>
--   <li><i><tt>year</tt></i> The year the report was generated</li>
--   <li><i><tt>month</tt></i> The month the report was generated</li>
--   <li><i><tt>day</tt></i> The day the report was generated</li>
--   <li><i><tt>hour</tt></i> The hour the report was generated</li>
--   <li><i><tt>wind</tt></i> The direction and strength of the wind</li>
--   <li><i><tt>visibility</tt></i> Description of current visibility
--   conditions</li>
--   <li><i><tt>skyCondition</tt></i> ?</li>
--   <li><i><tt>tempC</tt></i> The temperature in Celcius</li>
--   <li><i><tt>tempF</tt></i> The temperature in Farenheit</li>
--   <li><i><tt>dewPoint</tt></i> The current dew point</li>
--   <li><i><tt>humidity</tt></i> The current relative humidity</li>
--   <li><i><tt>pressure</tt></i> The current pressure</li>
--   </ul>
--   
--   As an example, a template like
--   
--   <pre>
--   "$tempF$ °F"
--   </pre>
--   
--   would yield a widget displaying the temperature in Farenheit with a
--   small label after it.
--   
--   Implementation Note: the weather data parsing code is taken from
--   xmobar. This version of the code makes direct HTTP requests instead of
--   invoking a separate cURL process.
module System.Taffybar.Weather

-- | The configuration for the weather widget. You can provide a custom
--   format string through <a>weatherTemplate</a> as described above, or
--   you can provide a custom function to turn a <a>WeatherInfo</a> into a
--   String via the <a>weatherFormatter</a> field.
data WeatherConfig
WeatherConfig :: String -> String -> WeatherFormatter -> WeatherConfig

-- | The weather station to poll. No default
weatherStation :: WeatherConfig -> String

-- | Template string, as described above. Default: $tempF$ °F
weatherTemplate :: WeatherConfig -> String

-- | Default: substitute in all interpolated variables (above)
weatherFormatter :: WeatherConfig -> WeatherFormatter
data WeatherInfo
WI :: String -> String -> String -> String -> String -> String -> String -> String -> String -> Int -> Int -> String -> Int -> Int -> WeatherInfo
stationPlace :: WeatherInfo -> String
stationState :: WeatherInfo -> String
year :: WeatherInfo -> String
month :: WeatherInfo -> String
day :: WeatherInfo -> String
hour :: WeatherInfo -> String
wind :: WeatherInfo -> String
visibility :: WeatherInfo -> String
skyCondition :: WeatherInfo -> String
tempC :: WeatherInfo -> Int
tempF :: WeatherInfo -> Int
dewPoint :: WeatherInfo -> String
humidity :: WeatherInfo -> Int
pressure :: WeatherInfo -> Int

-- | A wrapper to allow users to specify a custom weather formatter. The
--   default interpolates variables into a string as described above.
--   Custom formatters can do basically anything.
data WeatherFormatter

-- | Specify a custom formatter for <a>WeatherInfo</a>
WeatherFormatter :: (WeatherInfo -> String) -> WeatherFormatter

-- | Create a periodically-updating weather widget that polls NOAA.
weatherNew :: WeatherConfig -> Double -> IO Widget

-- | A sensible default configuration for the weather widget that just
--   renders the temperature.
defaultWeatherConfig :: String -> WeatherConfig
instance Show WeatherInfo


-- | 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 batterym 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.
module System.Taffybar.Battery

-- | A fancy graphical battery widget that represents the current charge as
--   a colored vertical bar. There is also a textual percentage readout
--   next to the bar.
batteryBarNew :: BarConfig -> Double -> IO Widget

-- | A simple textual battery widget that auto-updates once every polling
--   period (specified in seconds). The displayed format is specified using
--   a printf-style format string. The format string must have a single
--   format argument: %d (and any number of %% sequences to insert a
--   literal percent sign).
--   
--   More, fewer, or different format arguments will result in a runtime
--   error.
textBatteryNew :: String -> Double -> IO Widget

-- | A default configuration for the graphical battery display. The bar
--   will be red when power is critical (&lt; 10%), green if it is full
--   (&gt; 90%), and grey otherwise.
--   
--   You can customize this with any of the options in <a>BarConfig</a>
defaultBatteryConfig :: BarConfig

module System.Taffybar.FSMonitor
fsMonitorNew :: Double -> [String] -> IO Widget

module System.Taffybar.NetMonitor
netMonitorNew :: Double -> String -> IO Widget


-- | This module implements a very simple text-based clock widget. The
--   widget also toggles a calendar widget when clicked. This calendar is
--   not fancy at all and has no data backend.
module System.Taffybar.SimpleClock

-- | Create the widget. I recommend passing <tt>Nothing</tt> for the
--   TimeLocale parameter. The format string can include Pango markup
--   (http:<i></i>developer.gnome.org<i>pango</i>stable/PangoMarkupFormat.html).
textClockNew :: Maybe TimeLocale -> String -> Double -> IO Widget


-- | This is a very basic system tray widget. That said, it works very well
--   since it is based on eggtraymanager.
module System.Taffybar.Systray
systrayNew :: IO Widget


-- | This widget listens on DBus for Log events from XMonad and displays
--   the formatted status string. To log to this widget using the excellent
--   dbus-core library, use code like the following:
--   
--   <pre>
--   import DBus.Client.Simple
--   main = do
--     session &lt;- connectSession
--     emit session "/org/xmonad/Log" "org.xmonad.Log" "Update" [toVariant "msg"]
--   </pre>
--   
--   There is a more complete example of xmonad integration in the
--   top-level module.
module System.Taffybar.XMonadLog

-- | Return a new XMonad log widget
xmonadLogNew :: IO Widget

-- | A DBus-based logger with a default pretty-print configuration
dbusLog :: Client -> X ()

-- | This is a DBus-based logger that can be used from XMonad to log to
--   this widget. This version lets you specify the format for the log
--   using a pretty printer (e.g., <a>taffybarPP</a>).
dbusLogWithPP :: Client -> PP -> X ()

-- | The same as xmobarPP in XMonad.Hooks.DynamicLog
taffybarPP :: PP

-- | The same as defaultPP in XMonad.Hooks.DynamicLog
taffybarDefaultPP :: PP
taffybarColor :: String -> String -> String -> String

-- | Escape strings so that they can be safely displayed by Pango in the
--   bar widget
taffybarEscape :: String -> String


-- | The main module of Taffybar
module System.Taffybar
data TaffybarConfig
TaffybarConfig :: Int -> Int -> Int -> Position -> Maybe String -> [IO Widget] -> [IO Widget] -> TaffybarConfig

-- | The screen number to run the bar on (default is almost always fine)
screenNumber :: TaffybarConfig -> Int

-- | The xinerama/xrandr monitor number to put the bar on (default: 0)
monitorNumber :: TaffybarConfig -> Int

-- | Number of pixels to reserve for the bar (default: 25 pixels)
barHeight :: TaffybarConfig -> Int

-- | The position of the bar on the screen (default: Top)
barPosition :: TaffybarConfig -> Position

-- | Used by the application
errorMsg :: TaffybarConfig -> Maybe String

-- | Widgets that are packed in order at the left end of the bar
startWidgets :: TaffybarConfig -> [IO Widget]

-- | Widgets that are packed from right-to-left in the bar
endWidgets :: TaffybarConfig -> [IO Widget]

-- | The entry point of the application. Feed it a custom config.
defaultTaffybar :: TaffybarConfig -> IO ()

-- | The default configuration gives an empty bar 25 pixels high on monitor
--   0.
defaultTaffybarConfig :: TaffybarConfig
data Position
Top :: Position
Bottom :: Position
instance Show Position
instance Eq Position
