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

Copyright(c) José A. Romero L.
LicenseBSD3-style (see LICENSE)
MaintainerJosé A. Romero L. <escherdragon@gmail.com>
Stabilityunstable
Portabilityunportable
Safe HaskellNone
LanguageHaskell2010

System.Taffybar.Pager

Description

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 System.Taffybar.XMonadLog widget that is clickable and doesn't require DBus, you may want to see first System.Taffybar.TaffyPager.

You need only one Pager component to instantiate any number of pager widgets:

pager <- pagerNew defaultPagerConfig

let wss = wspaceSwitcherNew pager  -- Workspace Switcher widget
    los = layoutSwitcherNew pager  -- Layout Switcher widget
    wnd = windowSwitcherNew pager  -- Window Switcher widget

Synopsis

Documentation

data Pager Source #

Structure containing the state of the Pager.

Constructors

Pager 

Fields

data PagerConfig Source #

Structure contanining functions to customize the pretty printing of different widget elements.

Constructors

PagerConfig 

Fields

defaultPagerConfig :: PagerConfig Source #

Default pretty printing options.

pagerNew :: PagerConfig -> IO Pager Source #

Creates a new Pager component (wrapped in the IO Monad) that can be used by widgets for subscribing X11 events.

subscribe :: Pager -> Listener -> String -> IO () Source #

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.

colorize Source #

Arguments

:: String

Foreground color.

-> String

Background color.

-> String

Contents.

-> String 

Creates markup with the given foreground and background colors and the given contents.

shorten :: Int -> String -> String Source #

Limit a string to a certain length, adding "..." if truncated.

wrap Source #

Arguments

:: String

Left delimiter.

-> String

Right delimiter.

-> String

Output string.

-> String 

Wrap the given string in the given delimiters.

escape :: String -> String Source #

Escape strings so that they can be safely displayed by Pango in the bar widget