From a997cac7a38874ea9ae74040062bd6baf87eb7ef Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 31 Dec 2022 22:24:20 -0500 Subject: [PATCH] ENH run all of xmobar in rio --- bin/xmobar.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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