Copyright | (c) José A. Romero L. |
---|---|
License | BSD3-style (see LICENSE) |
Maintainer | José A. Romero L. <escherdragon@gmail.com> |
Stability | unstable |
Portability | unportable |
Safe Haskell | None |
Language | Haskell2010 |
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
- data Pager = Pager {
- config :: PagerConfig
- clients :: SubscriptionList
- pagerX11ContextVar :: IORef X11Context
- data PagerConfig = PagerConfig {
- activeWindow :: String -> String
- activeLayout :: String -> String
- activeLayoutIO :: String -> IO String
- activeWorkspace :: String -> String
- hiddenWorkspace :: String -> String
- emptyWorkspace :: String -> String
- visibleWorkspace :: String -> String
- urgentWorkspace :: String -> String
- widgetSep :: String
- workspaceBorder :: Bool
- workspaceGap :: Int
- workspacePad :: Bool
- useImages :: Bool
- imageSize :: Int
- fillEmptyImages :: Bool
- customIcon :: Bool -> String -> String -> Maybe FilePath
- windowSwitcherFormatter :: Map WorkspaceIdx String -> X11WindowHandle -> String
- type PagerIO a = ReaderT Pager IO a
- defaultPagerConfig :: PagerConfig
- pagerNew :: PagerConfig -> IO Pager
- subscribe :: Pager -> Listener -> String -> IO ()
- colorize :: String -> String -> String -> String
- liftPagerX11 :: X11Property a -> PagerIO a
- liftPagerX11Def :: a -> X11Property a -> PagerIO a
- runWithPager :: Pager -> X11Property a -> IO a
- shorten :: Int -> String -> String
- wrap :: String -> String -> String -> String
- escape :: String -> String
Documentation
Structure containing the state of the Pager.
Pager | |
|
data PagerConfig Source #
Structure contanining functions to customize the pretty printing of different widget elements.
PagerConfig | |
|
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.
Creates markup with the given foreground and background colors and the given contents.
liftPagerX11 :: X11Property a -> PagerIO a Source #
liftPagerX11Def :: a -> X11Property a -> PagerIO a Source #
runWithPager :: Pager -> X11Property a -> IO a Source #
shorten :: Int -> String -> String Source #
Limit a string to a certain length, adding "..." if truncated.
Wrap the given string in the given delimiters.