Copyright | (c) Ben Boeckel 2012 |
---|---|
License | BSD-style (as xmonad) |
Maintainer | mathstuf@gmail.com |
Stability | unstable |
Portability | unportable |
Safe Haskell | None |
Language | Haskell2010 |
Deprecated: Use XMonad.Hooks.StatusBar instead
Manage per-screen status bars.
Synopsis
- 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
dynStatusBarStartup
hook 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
dynStatusBarEventHook
hook which respawns status bars when the number of screens changes. The arguments are the same as for thedynStatusBarStartup
function. 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 additionalScreenId
argument which allows for more fine-grained control for shutting down a specific screen's status bar. - The
multiPP
function 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
multiPPFormat
function is the same as themultiPP
function, 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 DynamicStatusBarCleanup = IO () Source #
type DynamicStatusBarPartialCleanup = ScreenId -> IO () Source #
dynStatusBarStartup :: DynamicStatusBar -> DynamicStatusBarCleanup -> X () Source #
dynStatusBarEventHook :: DynamicStatusBar -> DynamicStatusBarCleanup -> Event -> X All Source #