taffybar-3.0.0: A desktop bar similar to xmobar, but with more GUI

Safe Haskell | None
Language | Haskell2010

System.Taffybar.Widget

Contents

- System.Taffybar.Widget.Battery
- System.Taffybar.Widget.CPUMonitor
- System.Taffybar.Widget.CommandRunner
- System.Taffybar.Widget.Decorators
- System.Taffybar.Widget.DiskIOMonitor
- System.Taffybar.Widget.FSMonitor
- System.Taffybar.Widget.FreedesktopNotifications
- System.Taffybar.Widget.Layout
- System.Taffybar.Widget.MPRIS2
- System.Taffybar.Widget.NetworkGraph
- System.Taffybar.Widget.SNITray
- System.Taffybar.Widget.SimpleClock
- System.Taffybar.Widget.Text.CPUMonitor
- System.Taffybar.Widget.Text.MemoryMonitor
- System.Taffybar.Widget.Text.NetworkMonitor
- System.Taffybar.Widget.Weather
- System.Taffybar.Widget.Windows
- System.Taffybar.Widget.Workspaces
- System.Taffybar.Widget.XDGMenu.MenuWidget

Synopsis

- module System.Taffybar.Widget.Util
- module System.Taffybar.Widget.Battery
- cpuMonitorNew :: MonadIO m => GraphConfig -> Double -> String -> m Widget
- commandRunnerNew :: MonadIO m => Double -> String -> [String] -> Text -> m Widget
- module System.Taffybar.Widget.Decorators
- dioMonitorNew :: MonadIO m => GraphConfig -> Double -> String -> m Widget
- fsMonitorNew :: MonadIO m => Double -> [String] -> m Widget
- data Notification = Notification {
  - noteAppName :: Text
  - noteReplaceId :: Word32
  - noteSummary :: Text
  - noteBody :: Text
  - noteExpireTimeout :: Maybe Int32
  - noteId :: Word32
  }
- data NotificationConfig = NotificationConfig {
  - notificationMaxTimeout :: Maybe Int32
  - notificationMaxLength :: Int
  - notificationFormatter :: [Notification] -> Text
  }
- defaultNotificationConfig :: NotificationConfig
- notifyAreaNew :: MonadIO m => NotificationConfig -> m Widget
- newtype LayoutConfig = LayoutConfig {
  - formatLayout :: Text -> TaffyIO Text
  }
- defaultLayoutConfig :: LayoutConfig
- layoutNew :: LayoutConfig -> TaffyIO Widget
- mpris2New :: TaffyIO Widget
- module System.Taffybar.Widget.NetworkGraph
- module System.Taffybar.Widget.SNITray
- textClockNew :: MonadIO m => Maybe TimeLocale -> String -> Double -> m Widget
- textClockNewWith :: MonadIO m => ClockConfig -> String -> Double -> m Widget
- defaultClockConfig :: ClockConfig
- data ClockConfig = ClockConfig {
  - clockTimeZone :: Maybe TimeZone
  - clockTimeLocale :: Maybe TimeLocale
  }
- module System.Taffybar.Widget.Text.CPUMonitor
- module System.Taffybar.Widget.Text.MemoryMonitor
- module System.Taffybar.Widget.Text.NetworkMonitor
- data WeatherConfig = WeatherConfig {
  - weatherStation :: String
  - weatherTemplate :: String
  - weatherTemplateTooltip :: String
  - weatherFormatter :: WeatherFormatter
  - weatherProxy :: Maybe String
  }
- data WeatherInfo = WI {
  - stationPlace :: String
  - stationState :: String
  - year :: String
  - month :: String
  - day :: String
  - hour :: String
  - wind :: String
  - visibility :: String
  - skyCondition :: String
  - tempC :: Int
  - tempF :: Int
  - dewPoint :: String
  - humidity :: Int
  - pressure :: Int
  }
- data WeatherFormatter = WeatherFormatter (WeatherInfo -> String)
- weatherNew :: MonadIO m => WeatherConfig -> Double -> m Widget
- weatherCustomNew :: MonadIO m => IO (Either String WeatherInfo) -> String -> String -> WeatherFormatter -> Double -> m Widget
- defaultWeatherConfig :: String -> WeatherConfig
- windowsNew :: WindowsConfig -> TaffyIO Widget
- data WindowsConfig = WindowsConfig {
  - getMenuLabel :: X11Window -> TaffyIO Text
  - getActiveLabel :: TaffyIO Text
  }
- defaultWindowsConfig :: WindowsConfig
- truncatedGetActiveLabel :: Int -> TaffyIO Text
- truncatedGetMenuLabel :: Int -> X11Window -> TaffyIO Text
- module System.Taffybar.Widget.Workspaces
- module System.Taffybar.Widget.XDGMenu.MenuWidget

# Documentation

module System.Taffybar.Widget.Util

# System.Taffybar.Widget.Battery

module System.Taffybar.Widget.Battery

# System.Taffybar.Widget.CPUMonitor

cpuMonitorNew Source #

Arguments

:: MonadIO m |
=> GraphConfig | Configuration data for the Graph.
-> Double | Polling period (in seconds).
-> String | Name of the core to watch (e.g. "cpu", "cpu0").
-> m Widget |

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.

# System.Taffybar.Widget.CommandRunner

commandRunnerNew Source #

Arguments

:: MonadIO m |
=> Double | Polling period (in seconds).
-> String | Command to execute. Should be in $PATH or an absolute path
-> [String] | Command argument. May be `[]`
-> Text | If command fails this will be displayed.
-> m Widget |

Creates a new command runner widget. This is a `PollingLabel` fed by regular calls to command given by argument. The results of calling this function are displayed as string.

# System.Taffybar.Widget.Decorators

module System.Taffybar.Widget.Decorators

# System.Taffybar.Widget.DiskIOMonitor

dioMonitorNew Source #

Arguments

:: MonadIO m |
=> GraphConfig | Configuration data for the Graph.
-> Double | Polling period (in seconds).
-> String | Name of the disk or partition to watch (e.g. "sda", "sdb1").
-> m Widget |

Creates a new disk IO monitor widget. This is a `PollingGraph` fed by regular calls to `getDiskTransfer`. The results of calling this function are normalized to the maximum value of the obtained probe (either read or write transfer).

# System.Taffybar.Widget.FSMonitor

fsMonitorNew Source #

Arguments

:: MonadIO m |
=> Double | Polling interval (in seconds, e.g. 500)
-> [String] | Names of the partitions to monitor (e.g. ["/", "/home"])
-> m Widget |

Creates a new filesystem monitor widget. It contains one `PollingLabel` that displays the data returned by the df command. The usage level of all requested partitions is extracted in one single operation.

# System.Taffybar.Widget.FreedesktopNotifications

data Notification Source #

A simple structure representing a Freedesktop notification

Constructors

Notification |

Fields

- noteAppName :: Text
- noteReplaceId :: Word32
- noteSummary :: Text
- noteBody :: Text
- noteExpireTimeout :: Maybe Int32
- noteId :: Word32

Instances

Eq Notification Source # |
Instance details Defined in System.Taffybar.Widget.FreedesktopNotifications Methods (==) :: Notification -> Notification -> Bool Source # (/=) :: Notification -> Notification -> Bool Source #
Show Notification Source # |
Instance details Defined in System.Taffybar.Widget.FreedesktopNotifications Methods showsPrec :: Int -> Notification -> ShowS Source # show :: Notification -> String Source # showList :: [Notification] -> ShowS Source #

data NotificationConfig Source #

Constructors

NotificationConfig |

Fields

- notificationMaxTimeout :: Maybe Int32

  Maximum time that a notification will be displayed (in seconds). Default: None

- notificationMaxLength :: Int

  Maximum length displayed, in characters. Default: 100

- notificationFormatter :: [Notification] -> Text

  Function used to format notifications, takes the notifications from first to last

defaultNotificationConfig :: NotificationConfig Source #

The default formatter is one of * Summary : Body * Summary * (N) Summary : Body * (N) Summary depending on the presence of a notification body, and where N is the number of queued notifications.

notifyAreaNew :: MonadIO m => NotificationConfig -> m Widget Source #

Create a new notification area with the given configuration.

# System.Taffybar.Widget.Layout

newtype LayoutConfig Source #

Constructors

LayoutConfig |

Fields

- formatLayout :: Text -> TaffyIO Text

defaultLayoutConfig :: LayoutConfig Source #

layoutNew :: LayoutConfig -> TaffyIO Widget Source #

Create a new Layout widget that will use the given Pager as its source of events.

# System.Taffybar.Widget.MPRIS2

mpris2New :: TaffyIO Widget Source #

# System.Taffybar.Widget.NetworkGraph

module System.Taffybar.Widget.NetworkGraph

# System.Taffybar.Widget.SNITray

module System.Taffybar.Widget.SNITray

# System.Taffybar.Widget.SimpleClock

textClockNew :: MonadIO m => Maybe TimeLocale -> String -> Double -> m Widget Source #

Create the widget. I recommend passing `Nothing` for the TimeLocale parameter. The format string can include Pango markup (http:/developer.gnome.orgpangostablePangoMarkupFormat.html).

textClockNewWith :: MonadIO m => ClockConfig -> String -> Double -> m Widget Source #

A configurable text-based clock widget. It currently allows for a configurable time zone through the `ClockConfig`.

See also `textClockNew`.

defaultClockConfig :: ClockConfig Source #

A clock configuration that defaults to the current locale

data ClockConfig Source #

Constructors

ClockConfig |

Fields

- clockTimeZone :: Maybe TimeZone
- clockTimeLocale :: Maybe TimeLocale

Instances

Eq ClockConfig Source # |
Instance details Defined in System.Taffybar.Widget.SimpleClock Methods (==) :: ClockConfig -> ClockConfig -> Bool Source # (/=) :: ClockConfig -> ClockConfig -> Bool Source #
Ord ClockConfig Source # |

Instance details

Defined in System.Taffybar.Widget.SimpleClock

Methods

compare :: ClockConfig -> ClockConfig -> Ordering Source #

(<) :: ClockConfig -> ClockConfig -> Bool Source #

(<=) :: ClockConfig -> ClockConfig -> Bool Source #

(>) :: ClockConfig -> ClockConfig -> Bool Source #

(>=) :: ClockConfig -> ClockConfig -> Bool Source #

max :: ClockConfig -> ClockConfig -> ClockConfig Source #

min :: ClockConfig -> ClockConfig -> ClockConfig Source #

Show ClockConfig Source # |
Instance details Defined in System.Taffybar.Widget.SimpleClock Methods showsPrec :: Int -> ClockConfig -> ShowS Source # show :: ClockConfig -> String Source # showList :: [ClockConfig] -> ShowS Source #

# System.Taffybar.Widget.Text.CPUMonitor

module System.Taffybar.Widget.Text.CPUMonitor

# System.Taffybar.Widget.Text.MemoryMonitor

module System.Taffybar.Widget.Text.MemoryMonitor

# System.Taffybar.Widget.Text.NetworkMonitor

module System.Taffybar.Widget.Text.NetworkMonitor

# System.Taffybar.Widget.Weather

data WeatherConfig Source #

The configuration for the weather widget. You can provide a custom format string through `weatherTemplate` as described above, or you can provide a custom function to turn a `WeatherInfo` into a String via the `weatherFormatter` field.

Constructors

WeatherConfig |

Fields

- weatherStation :: String

  The weather station to poll. No default

- weatherTemplate :: String

  Template string, as described above. Default: $tempF$ °F

- weatherTemplateTooltip :: String

  Template string, as described above. Default: $tempF$ °F

- weatherFormatter :: WeatherFormatter

  Default: substitute in all interpolated variables (above)

- weatherProxy :: Maybe String

  The proxy server, e.g. "http://proxy:port". Default: Nothing

data WeatherInfo Source #

Constructors

WI |

Fields

- stationPlace :: String
- stationState :: String
- year :: String
- month :: String
- day :: String
- hour :: String
- wind :: String
- visibility :: String
- skyCondition :: String
- tempC :: Int
- tempF :: Int
- dewPoint :: String
- humidity :: Int
- pressure :: Int

Instances

Show WeatherInfo Source # |
Instance details Defined in System.Taffybar.Widget.Weather Methods showsPrec :: Int -> WeatherInfo -> ShowS Source # show :: WeatherInfo -> String Source # showList :: [WeatherInfo] -> ShowS Source #

data WeatherFormatter Source #

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.

Constructors

WeatherFormatter (WeatherInfo -> String) | Specify a custom formatter for `WeatherInfo`

weatherNew Source #

Arguments

:: MonadIO m |
=> WeatherConfig | Configuration to render
-> Double | Polling period in _minutes_
-> m Widget |

Create a periodically-updating weather widget that polls NOAA.

weatherCustomNew Source #

Arguments

:: MonadIO m |
=> IO (Either String WeatherInfo) | Weather querying action
-> String | Weather template
-> String | Weather template
-> WeatherFormatter | Weather formatter
-> Double | Polling period in _minutes_
-> m Widget |

Create a periodically-updating weather widget using custom weather getter

defaultWeatherConfig :: String -> WeatherConfig Source #

A sensible default configuration for the weather widget that just renders the temperature.

# System.Taffybar.Widget.Windows

windowsNew :: WindowsConfig -> TaffyIO Widget Source #

Create a new Windows widget that will use the given Pager as its source of events.

data WindowsConfig Source #

Constructors

WindowsConfig |

Fields

- getMenuLabel :: X11Window -> TaffyIO Text

  A monadic function that will be used to make a label for the window in the window menu.

- getActiveLabel :: TaffyIO Text

  Action to build the label text for the active window.

defaultWindowsConfig :: WindowsConfig Source #

truncatedGetActiveLabel :: Int -> TaffyIO Text Source #

truncatedGetMenuLabel :: Int -> X11Window -> TaffyIO Text Source #

# System.Taffybar.Widget.Workspaces

module System.Taffybar.Widget.Workspaces

# System.Taffybar.Widget.XDGMenu.MenuWidget

module System.Taffybar.Widget.XDGMenu.MenuWidget