Removed unnecessary IO

This applies for withSB and withEasySB, as well as statusBarProp and
statusBarPropTo, making composability better. statusBarPipe is more
awkward to use now, but that's fine
This commit is contained in:
Yecine Megdiche
2021-04-03 12:38:01 +02:00
parent 654fa5045c
commit 168cb6a6c3
2 changed files with 36 additions and 33 deletions

View File

@@ -198,7 +198,7 @@ statusBar :: LayoutClass l Window
-> IO (XConfig (ModifiedLayout AvoidStruts l))
statusBar cmd pp k conf= do
sb <- statusBarPipe cmd (pure pp)
withEasySB sb k conf
return $ withEasySB sb k conf
-- |
-- Helper function which provides ToggleStruts keybinding
@@ -260,7 +260,6 @@ dynamicLogXinerama = withWindowSet $ io . putStrLn . pprWindowSetXinerama
-- the menu bar.
xmobarProp :: LayoutClass l Window
=> XConfig l -- ^ The base config
-> IO (XConfig (ModifiedLayout AvoidStruts l))
xmobarProp conf = do
xmobarPropConfig <- statusBarProp "xmobar" (pure xmobarPP)
withEasySB xmobarPropConfig toggleStrutsKey conf
-> XConfig (ModifiedLayout AvoidStruts l)
xmobarProp =
withEasySB (statusBarProp "xmobar" (pure xmobarPP)) toggleStrutsKey