diff --git a/bin/xmobar.hs b/bin/xmobar.hs index c43bcc2..45c6c5e 100644 --- a/bin/xmobar.hs +++ b/bin/xmobar.hs @@ -50,13 +50,14 @@ parse ["--test"] = void $ withCache . evalConfig =<< connectDBus parse _ = usage run :: IO () -run = do +run = withCache $ do db <- connectDBus - c <- withCache $ evalConfig db + c <- evalConfig db disconnectDBus db - -- this is needed to see any printed messages - hFlush stdout - xmobar c + liftIO $ do + -- this is needed to see any printed messages + hFlush stdout + xmobar c evalConfig :: DBusState -> FIO Config evalConfig db = do