-- 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.
@package taffybar
@version 0.4.6


-- | 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.

-- | <i>Deprecated: Use TaffyPager instead. This module will be
--   removed.</i>
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 the default PP 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


-- | 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, 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, 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


-- | Utility functions to facilitate building GTK interfaces.
module System.Taffybar.Widgets.Util

-- | Execute the given action as a response to any of the given types of
--   mouse button clicks.
onClick :: [Click] -> IO a -> EventM EButton Bool

-- | Attach the given widget as a popup with the given title to the given
--   window. The newly attached popup is not shown initially. Use the
--   <a>displayPopup</a> function to display it.
attachPopup :: (WidgetClass w, WindowClass wnd) => w -> String -> wnd -> IO ()

-- | Display the given popup widget (previously prepared using the
--   <a>attachPopup</a> function) immediately beneath (or above) the given
--   window.
displayPopup :: (WidgetClass w, WindowClass wnd) => w -> wnd -> IO ()


-- | 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


-- | 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, 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, 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 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) -> Int -> [(Double, Double, Double, Double)] -> [GraphStyle] -> Int -> Maybe String -> Int -> GraphDirection -> 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)

-- | The width of the border (default 1, use 0 to disable the border)
[graphBorderWidth] :: GraphConfig -> Int

-- | Colors for each data set (default cycles between red, green and blue)
[graphDataColors] :: GraphConfig -> [(Double, Double, Double, Double)]

-- | How to draw each data point (default <tt>repeat Area</tt>)
[graphDataStyles] :: GraphConfig -> [GraphStyle]

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

-- | May contain Pango markup (default <tt>Nothing</tt>)
[graphLabel] :: GraphConfig -> Maybe String

-- | The width (in pixels) of the graph widget (default 50)
[graphWidth] :: GraphConfig -> Int
[graphDirection] :: GraphConfig -> GraphDirection
data GraphDirection
LEFT_TO_RIGHT :: GraphDirection
RIGHT_TO_LEFT :: GraphDirection

-- | The style of the graph. Generally, you will want to draw all
--   <a>Area</a> graphs first, and then all <a>Line</a> graphs.
data GraphStyle

-- | Thea area below the value is filled
Area :: GraphStyle

-- | The values are connected by a line (one pixel wide)
Line :: GraphStyle
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
instance GHC.Classes.Eq System.Taffybar.Widgets.Graph.GraphDirection


-- | 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) -> Int -> [(Double, Double, Double, Double)] -> [GraphStyle] -> Int -> Maybe String -> Int -> GraphDirection -> 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)

-- | The width of the border (default 1, use 0 to disable the border)
[graphBorderWidth] :: GraphConfig -> Int

-- | Colors for each data set (default cycles between red, green and blue)
[graphDataColors] :: GraphConfig -> [(Double, Double, Double, Double)]

-- | How to draw each data point (default <tt>repeat Area</tt>)
[graphDataStyles] :: GraphConfig -> [GraphStyle]

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

-- | May contain Pango markup (default <tt>Nothing</tt>)
[graphLabel] :: GraphConfig -> Maybe String

-- | The width (in pixels) of the graph widget (default 50)
[graphWidth] :: GraphConfig -> Int
[graphDirection] :: GraphConfig -> GraphDirection
data GraphDirection
LEFT_TO_RIGHT :: GraphDirection
RIGHT_TO_LEFT :: GraphDirection

-- | The style of the graph. Generally, you will want to draw all
--   <a>Area</a> graphs first, and then all <a>Line</a> graphs.
data GraphStyle

-- | Thea area below the value is filled
Area :: GraphStyle

-- | The values are connected by a line (one pixel wide)
Line :: GraphStyle
pollingGraphNew :: GraphConfig -> Double -> IO [Double] -> IO Widget
defaultGraphConfig :: GraphConfig


-- | This module defines a simple textual weather widget that polls NOAA
--   for weather data. To find your weather station, you can use
--   
--   <a>http://www.nws.noaa.gov/tg/siteloc.php</a>
--   
--   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

-- | Create a periodically-updating weather widget using custom weather
--   getter
weatherCustomNew :: IO (Either String WeatherInfo) -> String -> WeatherFormatter -> Double -> IO Widget

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


-- | 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 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>developer.gnome.org</i>pango<i>stable</i>PangoMarkupFormat.html).
textClockNew :: Maybe TimeLocale -> String -> Double -> IO Widget

-- | A configurable text-based clock widget. It currently allows for a
--   configurable time zone through the <a>ClockConfig</a>.
--   
--   See also <a>textClockNew</a>.
textClockNewWith :: ClockConfig -> String -> Double -> IO Widget

-- | A clock configuration that defaults to the current locale
defaultClockConfig :: ClockConfig
data ClockConfig
ClockConfig :: Maybe TimeZone -> Maybe TimeLocale -> ClockConfig
[clockTimeZone] :: ClockConfig -> Maybe TimeZone
[clockTimeLocale] :: ClockConfig -> Maybe TimeLocale
instance GHC.Show.Show System.Taffybar.SimpleClock.ClockConfig
instance GHC.Classes.Ord System.Taffybar.SimpleClock.ClockConfig
instance GHC.Classes.Eq System.Taffybar.SimpleClock.ClockConfig


-- | This is a "Now Playing"-style widget that listens for MPRIS events on
--   DBus. Various media players implement this. This widget works with
--   version 2 of the MPRIS protocol
--   (http:/<i>www.mpris.org</i>2.0/spec.html).
module System.Taffybar.MPRIS2
mpris2New :: IO Widget


-- | This is a "Now Playing"-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>www.mpris.org</i>1.0/spec.html). Support for version 2 will
--   be in a separate widget.
module System.Taffybar.MPRIS
data TrackInfo
TrackInfo :: Maybe String -> Maybe String -> Maybe String -> TrackInfo

-- | Artist name, if available.
[trackArtist] :: TrackInfo -> Maybe String

-- | Track name, if available.
[trackTitle] :: TrackInfo -> Maybe String

-- | Album name, if available.
[trackAlbum] :: TrackInfo -> Maybe String
data MPRISConfig
MPRISConfig :: (TrackInfo -> String) -> MPRISConfig

-- | Calculate a label to display.
[trackLabel] :: MPRISConfig -> TrackInfo -> String
defaultMPRISConfig :: MPRISConfig
mprisNew :: MPRISConfig -> IO Widget


-- | Complements the <a>XMonad.Hooks.EwmhDesktops</a> with two additional
--   hints not contemplated by the EWMH standard:
--   
--   <ul>
--   <li><i><tt>_XMONAD_CURRENT_LAYOUT</tt></i> Contains a UTF-8 string
--   with the name of the windows layout currently used in the active
--   workspace.</li>
--   <li><i><tt>_XMONAD_VISIBLE_WORKSPACES</tt></i> Contains a list of
--   UTF-8 strings with the names of all the workspaces that are currently
--   showed in a secondary display, or an empty list if in the current
--   installation there's only one monitor.</li>
--   </ul>
--   
--   The first hint can be set directly on the root window of the default
--   display, or indirectly via X11 events with an atom of the same name.
--   This allows both to track any changes that occur in the layout of the
--   current workspace, as well as to have it changed automatically by just
--   sending a custom event to the hook.
--   
--   The second one should be considered read-only, and is set every time
--   XMonad calls its log hooks.
module System.Taffybar.Hooks.PagerHints

-- | Add support for the "Current Layout" and "Visible Workspaces" custom
--   hints to the given config.
pagerHints :: XConfig a -> XConfig a


-- | This widget listens on DBus for freedesktop notifications
--   (http:/<i>developer.gnome.org</i>notification-spec/). 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 GHC.Classes.Eq System.Taffybar.FreedesktopNotifications.Notification
instance GHC.Show.Show System.Taffybar.FreedesktopNotifications.Notification


-- | Simple text widget that monitors the current usage of selected disk
--   partitions by regularly parsing the output of the df command in Linux
--   systems.
module System.Taffybar.FSMonitor

-- | Creates a new filesystem monitor widget. It contains one
--   <tt>PollingLabel</tt> that displays the data returned by the df
--   command. The usage level of all requested partitions is extracted in
--   one single operation.
fsMonitorNew :: Double -> [String] -> IO Widget


-- | Low-level functions to access data provided by the X11 desktop via
--   window properties. One of them (<a>getVisibleTags</a>) depends on the
--   PagerHints hook being installed in your <tt>~/.xmonad/xmonad.hs</tt>
--   configuration:
--   
--   <pre>
--   import System.Taffybar.Hooks.PagerHints (pagerHints)
--   
--   main = xmonad $ ewmh $ pagerHints $ ...
--   </pre>
module System.Information.X11DesktopInfo
data X11Context
type X11Property a = ReaderT X11Context IO a
type X11Window = Window

-- | Put the current display and root window objects inside a Reader
--   transformer for further computation.
withDefaultCtx :: X11Property a -> IO a

-- | Retrieve the property of the given window (or the root window, if
--   Nothing) with the given name as a value of type Int. If that property
--   hasn't been set, then return -1.
readAsInt :: Maybe X11Window -> String -> X11Property Int

-- | Retrieve the property of the given window (or the root window, if
--   Nothing) with the given name as a String. If the property hasn't been
--   set, then return an empty string.
readAsString :: Maybe X11Window -> String -> X11Property String

-- | Retrieve the property of the given window (or the root window, if
--   Nothing) with the given name as a list of Strings. If the property
--   hasn't been set, then return an empty list.
readAsListOfString :: Maybe X11Window -> String -> X11Property [String]

-- | Retrieve the property of the given window (or the root window, if
--   Nothing) with the given name as a list of X11 Window IDs. If the
--   property hasn't been set, then return an empty list.
readAsListOfWindow :: Maybe X11Window -> String -> X11Property [X11Window]

-- | Determine whether the "urgent" flag is set in the WM_HINTS of the
--   given window.
isWindowUrgent :: X11Window -> X11Property Bool

-- | Retrieve the value of the special _XMONAD_VISIBLE_WORKSPACES hint set
--   by the PagerHints hook provided by Taffybar (see module documentation
--   for instructions on how to do this), or an empty list of strings if
--   the PagerHints hook is not available.
getVisibleTags :: X11Property [String]

-- | Return the Atom with the given name.
getAtom :: String -> X11Property Atom

-- | Spawn a new thread and listen inside it to all incoming events,
--   invoking the given function to every event of type
--   <tt>MapNotifyEvent</tt> that arrives, and subscribing to all events of
--   this type emitted by newly created windows.
eventLoop :: (Event -> IO ()) -> X11Property ()

-- | Emit a "command" event with one argument for the X server. This is
--   used to send events that can be received by event hooks in the XMonad
--   process and acted upon in that context.
sendCommandEvent :: Atom -> Atom -> X11Property ()

-- | Similar to <a>sendCommandEvent</a>, but with an argument of type
--   Window.
sendWindowEvent :: Atom -> X11Window -> X11Property ()


-- | Common support for pager widgets. This module does not provide itself
--   any widgets, but implements an event dispatcher on which widgets can
--   subscribe the desktop events they're interested in, as well as common
--   configuration facilities.
--   
--   N.B. If you're just looking for a drop-in replacement for the
--   <a>System.Taffybar.XMonadLog</a> widget that is clickable and doesn't
--   require DBus, you may want to see first
--   <a>System.Taffybar.TaffyPager</a>.
--   
--   You need only one Pager component to instantiate any number of pager
--   widgets:
--   
--   <pre>
--   pager &lt;- pagerNew defaultPagerConfig
--   
--   let wss = wspaceSwitcherNew pager  -- Workspace Switcher widget
--       los = layoutSwitcherNew pager  -- Layout Switcher widget
--       wnd = windowSwitcherNew pager  -- Window Switcher widget
--   </pre>
module System.Taffybar.Pager

-- | Structure containing the state of the Pager.
data Pager

-- | Structure contanining functions to customize the pretty printing of
--   different widget elements.
data PagerConfig
PagerConfig :: (String -> String) -> (String -> String) -> (String -> String) -> (String -> String) -> (String -> String) -> (String -> String) -> (String -> String) -> String -> PagerConfig

-- | the name of the active window.
[activeWindow] :: PagerConfig -> String -> String

-- | the currently active layout.
[activeLayout] :: PagerConfig -> String -> String

-- | the currently active workspace.
[activeWorkspace] :: PagerConfig -> String -> String

-- | inactive workspace with windows.
[hiddenWorkspace] :: PagerConfig -> String -> String

-- | inactive workspace with no windows.
[emptyWorkspace] :: PagerConfig -> String -> String

-- | all other visible workspaces (Xinerama or XRandR).
[visibleWorkspace] :: PagerConfig -> String -> String

-- | workspaces containing windows with the urgency hint set.
[urgentWorkspace] :: PagerConfig -> String -> String

-- | separator to use between desktop widgets in <tt>TaffyPager</tt>.
[widgetSep] :: PagerConfig -> String

-- | Default pretty printing options.
defaultPagerConfig :: PagerConfig

-- | Creates a new Pager component (wrapped in the IO Monad) that can be
--   used by widgets for subscribing X11 events.
pagerNew :: PagerConfig -> IO Pager

-- | Registers the given Listener as a subscriber of events of the given
--   type: whenever a new event of the type with the given name arrives to
--   the Pager, it will execute Listener on it.
subscribe :: Pager -> Listener -> String -> IO ()

-- | Creates markup with the given foreground and background colors and the
--   given contents.
colorize :: String -> String -> String -> String

-- | Limit a string to a certain length, adding "..." if truncated.
shorten :: Int -> String -> String

-- | Wrap the given string in the given delimiters.
wrap :: String -> String -> String -> String

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


-- | Simple function which runs user defined command and returns it's
--   output in PollingLabel widget
module System.Taffybar.CommandRunner

-- | Creates a new command runner widget. This is a <tt>PollingLabel</tt>
--   fed by regular calls to command given by argument. The results of
--   calling this function are displayed as string.
commandRunnerNew :: Double -> String -> [String] -> String -> String -> IO Widget


-- | Simple text widget that shows the XMonad layout used in the currently
--   active workspace, and that allows to change it by clicking with the
--   mouse: left-click to switch to the next layout in the list,
--   right-click to switch to the first one (as configured in
--   <tt>xmonad.hs</tt>)
--   
--   N.B. If you're just looking for a drop-in replacement for the
--   <a>System.Taffybar.XMonadLog</a> widget that is clickable and doesn't
--   require DBus, you may want to see first
--   <a>System.Taffybar.TaffyPager</a>.
module System.Taffybar.LayoutSwitcher

-- | Create a new LayoutSwitcher widget that will use the given Pager as
--   its source of events.
layoutSwitcherNew :: Pager -> IO Widget


-- | 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, [a])]) -> String -> IO [a]

-- | 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 :: (Integral a, RealFloat b) => b -> IO [a] -> IO [b]

-- | Similar to getLoad, but execute the given action only once and use the
--   given IORef to calculate the result and to save the current value, so
--   it can be reused in the next call.
getAccLoad :: (Integral a, RealFloat b) => IORef [a] -> IO [a] -> IO [b]

-- | Probe the given action and, interpreting the result as a variation in
--   time, return the speed of change of its values.
getTransfer :: (Integral a, RealFloat b) => b -> IO [a] -> IO [b]


-- | Provides information about network traffic over selected interfaces,
--   obtained from parsing the <tt>/proc/net/dev</tt> file using some of
--   the facilities provided by the <a>System.Information.StreamInfo</a>
--   module.
module System.Information.Network

-- | Returns a two-element list containing the current number of bytes
--   received and transmitted via the given network interface (e.g.
--   "wlan0"), according to the contents of the <tt>/proc/dev/net</tt>
--   file.
getNetInfo :: String -> IO (Maybe [Integer])


-- | Simple text widget that displays incoming/outgoing network traffic
--   over one selected interface, as provided by the
--   <a>System.Information.Network</a> module.
module System.Taffybar.NetMonitor

-- | Creates a new network monitor widget. It consists of two
--   <tt>PollingLabel</tt>s, one for incoming and one for outgoing traffic
--   fed by regular calls to <a>getNetInfo</a>.
netMonitorNew :: Double -> String -> IO Widget

-- | Creates a new network monitor widget with custom template and
--   precision. Similar to <a>netMonitorNew</a>.
--   
--   The format template currently supports three units: bytes, kilobytes,
--   and megabytes. Automatic intelligent unit selection is planned,
--   eventually.
netMonitorNewWith :: Double -> String -> Integer -> String -> IO Widget
defaultNetFormat :: String

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

module System.Taffybar.Text.MemoryMonitor

-- | Creates a simple textual memory monitor. It updates once every polling
--   period (in seconds).
textMemoryMonitorNew :: String -> Double -> IO Widget


-- | Functions to access data provided by the X11 desktop via EWHM hints.
--   This module requires that the EwmhDesktops hook from the XMonadContrib
--   project be installed in your <tt>~/.xmonad/xmonad.hs</tt>
--   configuration:
--   
--   <pre>
--   import XMonad
--   import XMonad.Hooks.EwmhDesktops (ewmh)
--   
--   main = xmonad $ ewmh $ ...
--   </pre>
module System.Information.EWMHDesktopInfo
type X11Window = Window

-- | Convenience alias for a pair of the form (props, window), where props
--   is a tuple of the form (workspace index, window title, window class),
--   and window is the internal ID of an open window.
type X11WindowHandle = ((WorkspaceIdx, String, String), X11Window)
newtype WorkspaceIdx
WSIdx :: Int -> WorkspaceIdx

-- | Put the current display and root window objects inside a Reader
--   transformer for further computation.
withDefaultCtx :: X11Property a -> IO a

-- | Determine whether the "urgent" flag is set in the WM_HINTS of the
--   given window.
isWindowUrgent :: X11Window -> X11Property Bool

-- | Retrieve the index of the current workspace in the desktop, starting
--   from 0.
getCurrentWorkspace :: X11Property WorkspaceIdx

-- | Retrieve the indexes of all currently visible workspaces with the
--   active workspace at the head of the list.
getVisibleWorkspaces :: X11Property [WorkspaceIdx]

-- | Return a list with the names of all the workspaces currently
--   available.
getWorkspaceNames :: X11Property [(WorkspaceIdx, String)]

-- | Ask the window manager to switch to the workspace with the given
--   index, starting from 0.
switchToWorkspace :: WorkspaceIdx -> X11Property ()

-- | Move one workspace up or down from the current workspace
switchOneWorkspace :: Bool -> Int -> X11Property ()

-- | Get the title of the given X11 window.
getWindowTitle :: X11Window -> X11Property String

-- | Get the class of the given X11 window.
getWindowClass :: X11Window -> X11Property String

-- | Get the title of the currently focused window.
getActiveWindowTitle :: X11Property String

-- | Return a list of all windows
getWindows :: X11Property [X11Window]

-- | Return a list of X11 window handles, one for each window open. Refer
--   to the documentation of <a>X11WindowHandle</a> for details on the
--   structure returned.
getWindowHandles :: X11Property [X11WindowHandle]

-- | Return the index (starting from 0) of the workspace on which the given
--   window is being displayed.
getWorkspace :: X11Window -> X11Property WorkspaceIdx

-- | Ask the window manager to give focus to the given window.
focusWindow :: X11Window -> X11Property ()
instance GHC.Classes.Eq System.Information.EWMHDesktopInfo.WorkspaceIdx
instance GHC.Classes.Ord System.Information.EWMHDesktopInfo.WorkspaceIdx
instance GHC.Read.Read System.Information.EWMHDesktopInfo.WorkspaceIdx
instance GHC.Show.Show System.Information.EWMHDesktopInfo.WorkspaceIdx


-- | Menu widget that shows the title of the currently focused window and
--   that, when clicked, displays the list of all currently open windows
--   allowing to switch to any of them.
--   
--   N.B. If you're just looking for a drop-in replacement for the
--   <a>System.Taffybar.XMonadLog</a> widget that is clickable and doesn't
--   require DBus, you may want to see first
--   <a>System.Taffybar.TaffyPager</a>.
module System.Taffybar.WindowSwitcher

-- | Create a new WindowSwitcher widget that will use the given Pager as
--   its source of events.
windowSwitcherNew :: Pager -> IO Widget


-- | Composite widget that displays all currently configured workspaces and
--   allows to switch to any of them by clicking on its label. Supports
--   also urgency hints and (with an additional hook) display of other
--   visible workspaces besides the active one (in Xinerama or XRandR
--   installations).
--   
--   N.B. If you're just looking for a drop-in replacement for the
--   <a>System.Taffybar.XMonadLog</a> widget that is clickable and doesn't
--   require DBus, you may want to see first
--   <a>System.Taffybar.TaffyPager</a>.
module System.Taffybar.WorkspaceSwitcher

-- | Create a new WorkspaceSwitcher widget that will use the given Pager as
--   its source of events.
wspaceSwitcherNew :: Pager -> IO Widget


-- | This module provides a drop-in replacement for the XMonadLog widget
--   that allows to:
--   
--   <ul>
--   <li>click on a workspace label to switch to that workspace,</li>
--   <li>left-click on the layout label to switch to the next layout, and
--   right-click to switch to the first layout,</li>
--   <li>click on the window title to pop-up a list of all the currently
--   open windows that can be clicked to switch to any of them,</li>
--   </ul>
--   
--   All its interactions with the windows manager are performed via EWMH
--   hints and X11 events.
--   
--   This widget is actually only a convenience wrapper around a Pager, a
--   WorkspaceSwitcher, a LayoutSwitcher and a WindowSwitcher. If you are
--   looking for more advanced configurations (like having components
--   displayed separately, or using only part of them), consult directly
--   the documentation for each of the components.
module System.Taffybar.TaffyPager

-- | Create a new TaffyPager widget.
taffyPagerNew :: PagerConfig -> IO Widget

-- | Structure contanining functions to customize the pretty printing of
--   different widget elements.
data PagerConfig
PagerConfig :: (String -> String) -> (String -> String) -> (String -> String) -> (String -> String) -> (String -> String) -> (String -> String) -> (String -> String) -> String -> PagerConfig

-- | the name of the active window.
[activeWindow] :: PagerConfig -> String -> String

-- | the currently active layout.
[activeLayout] :: PagerConfig -> String -> String

-- | the currently active workspace.
[activeWorkspace] :: PagerConfig -> String -> String

-- | inactive workspace with windows.
[hiddenWorkspace] :: PagerConfig -> String -> String

-- | inactive workspace with no windows.
[emptyWorkspace] :: PagerConfig -> String -> String

-- | all other visible workspaces (Xinerama or XRandR).
[visibleWorkspace] :: PagerConfig -> String -> String

-- | workspaces containing windows with the urgency hint set.
[urgentWorkspace] :: PagerConfig -> String -> String

-- | separator to use between desktop widgets in <tt>TaffyPager</tt>.
[widgetSep] :: PagerConfig -> String

-- | Default pretty printing options.
defaultPagerConfig :: PagerConfig


-- | Provides information about read/write operations in a given disk or
--   partition, obtained from parsing the <tt>/proc/diskstats</tt> file
--   with some of the facilities included in the
--   <a>System.Information.StreamInfo</a> module.
module System.Information.DiskIO

-- | Returns a two-element list containing the speed of transfer for read
--   and write operations performed in the given disk/partition (e.g.
--   "sda", "sda1").
getDiskTransfer :: String -> IO [Double]


-- | Simple Disk IO monitor that uses a PollingGraph to visualize the speed
--   of read/write operations in one selected disk or partition.
module System.Taffybar.DiskIOMonitor

-- | Creates a new disk IO monitor widget. This is a <tt>PollingGraph</tt>
--   fed by regular calls to <a>getDiskTransfer</a>. The results of calling
--   this function are normalized to the maximum value of the obtained
--   probe (either read or write transfer).
dioMonitorNew :: GraphConfig -> Double -> String -> IO Widget


-- | Provides information about used CPU times, obtained from parsing the
--   <tt>/proc/stat</tt> file using some of the facilities included in the
--   <a>System.Information.StreamInfo</a> module. And also provides
--   information about the temperature of cores. (Now supports only
--   physical cpu).
module System.Information.CPU2

-- | Returns a two-element list containing relative system and user times
--   calculated using two almost simultaneous samples of the
--   <tt>/proc/stat</tt> file for the given core (or all of them
--   aggregated, if "cpu" is passed).
getCPULoad :: String -> IO [Double]

-- | Returns a list of 5 to 7 elements containing all the values available
--   for the given core (or all of them aggregated, if "cpu" is passed).
getCPUInfo :: String -> IO [Int]

-- | Returns a list containing temperatures of user given cpu cores. Use
--   ["cpu1", "cpu2".."cpuN"] to get temperature of exact cores. Use
--   ["cpu0"] to get common temperature.
getCPUTemp :: [String] -> IO [Int]


-- | Simple CPU monitor that uses a PollingGraph to visualize variations in
--   the user and system CPU times in one selected core, or in all cores
--   available.
module System.Taffybar.CPUMonitor

-- | Creates a new CPU monitor. This is a PollingGraph fed by regular calls
--   to getCPUInfo, associated to an IORef used to remember the values
--   yielded by the last call to this function.
cpuMonitorNew :: GraphConfig -> Double -> String -> IO Widget
probe :: IORef [Int] -> String -> IO [Double]

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.Taffybar.Text.CPUMonitor

-- | Creates a simple textual CPU monitor. It updates once every polling
--   period (in seconds).
textCpuMonitorNew :: String -> Double -> IO Widget


-- | 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 (Maybe BatteryInfo)
instance GHC.Enum.Enum System.Information.Battery.BatteryTechnology
instance GHC.Classes.Eq System.Information.Battery.BatteryTechnology
instance GHC.Classes.Ord System.Information.Battery.BatteryTechnology
instance GHC.Show.Show System.Information.Battery.BatteryTechnology
instance GHC.Enum.Enum System.Information.Battery.BatteryState
instance GHC.Classes.Eq System.Information.Battery.BatteryState
instance GHC.Classes.Ord System.Information.Battery.BatteryState
instance GHC.Show.Show System.Information.Battery.BatteryState
instance GHC.Enum.Enum System.Information.Battery.BatteryType
instance GHC.Classes.Eq System.Information.Battery.BatteryType
instance GHC.Classes.Ord System.Information.Battery.BatteryType
instance GHC.Show.Show System.Information.Battery.BatteryType


-- | 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
--   format string where $percentage$ is replaced with the percentage of
--   battery remaining and $time$ is replaced with the time until the
--   battery is fully charged/discharged.
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


-- | The main module of Taffybar
module System.Taffybar
data TaffybarConfig
TaffybarConfig :: Int -> Int -> Int -> Position -> Int -> 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

-- | The number of pixels between widgets
[widgetSpacing] :: TaffybarConfig -> Int

-- | 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
taffybarMain :: TaffybarConfig -> IO ()
instance GHC.Classes.Eq System.Taffybar.Position
instance GHC.Show.Show System.Taffybar.Position
