From 745a548baff6f2958317db3084ee1e1ea2f2656b Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sat, 31 Dec 2022 23:18:41 -0500 Subject: [PATCH] ENH enable line buffering in xmobar --- bin/xmobar.hs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/bin/xmobar.hs b/bin/xmobar.hs index 026d474..f15b839 100644 --- a/bin/xmobar.hs +++ b/bin/xmobar.hs @@ -18,7 +18,6 @@ import qualified RIO.ByteString.Lazy as BL import RIO.List import RIO.Process import qualified RIO.Text as T -import System.IO import UnliftIO.Environment import XMonad.Core hiding (config) import XMonad.Internal.Command.Desktop @@ -50,12 +49,12 @@ parse ["--test"] = withCache $ withDBus_ evalConfig parse _ = usage run :: IO () -run = withCache $ withDBus_ $ \db -> do - c <- evalConfig db - liftIO $ do - -- this is needed to see any printed messages - hFlush stdout - xmobar c +run = do + -- IDK why this is needed, I thought this was default + hSetBuffering stdout LineBuffering + withCache $ withDBus_ $ \db -> do + c <- evalConfig db + liftIO $ xmobar c evalConfig :: DBusState -> FIO Config evalConfig db = do