diff --git a/CHANGES.md b/CHANGES.md index f47ee054..0bb47551 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -172,6 +172,9 @@ some status bars (see this [polybar issue](https://github.com/polybar/polybar/issues/2603)). + * `XMonad.Hooks.StatusBar` + - Added `startAllStatusBars` to start the configured status bars. + ### Other changes ## 0.17.1 (September 3, 2022) diff --git a/XMonad/Hooks/StatusBar.hs b/XMonad/Hooks/StatusBar.hs index 3ec54a08..d1623268 100644 --- a/XMonad/Hooks/StatusBar.hs +++ b/XMonad/Hooks/StatusBar.hs @@ -56,6 +56,7 @@ module XMonad.Hooks.StatusBar ( spawnStatusBar, killStatusBar, killAllStatusBars, + startAllStatusBars, ) where import Control.Exception (SomeException, try) @@ -564,3 +565,9 @@ spawnStatusBar cmd = do killAllStatusBars :: X () killAllStatusBars = XS.gets (M.elems . getPIDs) >>= io . traverse_ killPid >> XS.put (StatusBarPIDs mempty) + +-- | Start all status bars. Note that you do not need this in your startup hook. +-- This can be bound to a keybinding for example to be used in tandem with +-- `killAllStatusBars`. +startAllStatusBars :: X () +startAllStatusBars = XS.get >>= traverse_ (sbStartupHook . snd) . getASBs