mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
X.H.StatusBar.PP: Clarify ppOutput doc + minor cleanups
This commit is contained in:
parent
c3b67ab0df
commit
b6cd47db29
@ -335,9 +335,8 @@ statusBarPipe cmd xpp = do
|
||||
return $ def
|
||||
{ sbStartupHook = io (writeIORef hRef . Just =<< spawnPipe cmd)
|
||||
, sbLogHook = do
|
||||
pp <- xpp
|
||||
h' <- io (readIORef hRef)
|
||||
whenJust h' $ \h -> dynamicLogWithPP pp { ppOutput = hPutStrLn h }
|
||||
whenJust h' $ \h -> io . hPutStrLn h =<< dynamicLogString =<< xpp
|
||||
, sbCleanupHook = io
|
||||
$ readIORef hRef
|
||||
>>= (`whenJust` hClose)
|
||||
|
@ -128,7 +128,9 @@ data PP = PP { ppCurrent :: WorkspaceId -> String
|
||||
-- output it. Can be used to specify an alternative
|
||||
-- output method (e.g. write to a pipe instead of
|
||||
-- stdout), and\/or to perform some last-minute
|
||||
-- formatting.
|
||||
-- formatting. Note that this is only used by
|
||||
-- 'dynamicLogWithPP'; it won't work with 'dynamicLogString' or
|
||||
-- "XMonad.Hooks.StatusBar".
|
||||
}
|
||||
|
||||
-- | The default pretty printing options:
|
||||
@ -179,7 +181,7 @@ dynamicLogString pp = do
|
||||
let ws = pprWindowSet sort' urgents pp winset
|
||||
|
||||
-- run extra loggers, ignoring any that generate errors.
|
||||
extras <- mapM (`catchX` return Nothing) $ ppExtras pp
|
||||
extras <- mapM (userCodeDef Nothing) $ ppExtras pp
|
||||
|
||||
-- window title
|
||||
wt <- maybe (pure "") (fmap show . getName) . S.peek $ winset
|
||||
|
Loading…
x
Reference in New Issue
Block a user