| Copyright | (c) Ben Boeckel 2012 |
|---|---|
| License | BSD-style (as xmonad) |
| Maintainer | mathstuf@gmail.com |
| Stability | unstable |
| Portability | unportable |
| Safe Haskell | None |
| Language | Haskell98 |
XMonad.Hooks.DynamicBars
Contents
Description
Manage per-screen status bars.
- type DynamicStatusBar = ScreenId -> IO Handle
- type DynamicStatusBarCleanup = IO ()
- type DynamicStatusBarPartialCleanup = ScreenId -> IO ()
- dynStatusBarStartup :: DynamicStatusBar -> DynamicStatusBarCleanup -> X ()
- dynStatusBarStartup' :: DynamicStatusBar -> DynamicStatusBarPartialCleanup -> X ()
- dynStatusBarEventHook :: DynamicStatusBar -> DynamicStatusBarCleanup -> Event -> X All
- dynStatusBarEventHook' :: DynamicStatusBar -> DynamicStatusBarPartialCleanup -> Event -> X All
- multiPP :: PP -> PP -> X ()
- multiPPFormat :: (PP -> X String) -> PP -> PP -> X ()
Usage
Provides a few helper functions to manage per-screen status bars while dynamically responding to screen changes. A startup action, event hook, and a way to separate PP styles based on the screen's focus are provided:
- The
dynStatusBarStartuphook which initializes the status bars. The first argument is an `ScreenId -> IO Handle` which spawns a status bar on the given screen and returns the pipe which the string should be written to. The second argument is a `IO ()` to shut down all status bars. This should be placed in yourstartupHook. - The
dynStatusBarEventHookhook which respawns status bars when the number of screens changes. The arguments are the same as for thedynStatusBarStartupfunction. This should be placed in yourhandleEventHook. - Each of the above functions have an alternate form
(
dynStatusBarStartup'anddynStatusBarEventHook') which use a cleanup function which takes an additionalScreenIdargument which allows for more fine-grained control for shutting down a specific screen's status bar. - The
multiPPfunction which allows for different output based on whether the screen for the status bar has focus (the first argument) or not (the second argument). This is for use in yourlogHook. - The
multiPPFormatfunction is the same as themultiPPfunction, but it also takes in a function that can customize the output to status bars.
The hooks take a DynamicStatusBar function which is given the id of the
screen to start up and returns the Handle to the pipe to write to. The
DynamicStatusBarCleanup argument should tear down previous instances. It
is called when the number of screens changes and on startup.
type DynamicStatusBar = ScreenId -> IO Handle #
type DynamicStatusBarCleanup = IO () #
type DynamicStatusBarPartialCleanup = ScreenId -> IO () #
dynStatusBarStartup :: DynamicStatusBar -> DynamicStatusBarCleanup -> X () #
dynStatusBarEventHook :: DynamicStatusBar -> DynamicStatusBarCleanup -> Event -> X All #