diff options
Diffstat (limited to 'src/Xmobar/Run/Loop.hs')
-rw-r--r-- | src/Xmobar/Run/Loop.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Xmobar/Run/Loop.hs b/src/Xmobar/Run/Loop.hs index 9954cb9..343a857 100644 --- a/src/Xmobar/Run/Loop.hs +++ b/src/Xmobar/Run/Loop.hs @@ -28,6 +28,7 @@ import Data.Foldable (for_) import Xmobar.System.Signal import Xmobar.Config.Types +import Xmobar.Config.Template (withEmptyAction) import Xmobar.Run.Runnable (Runnable) import Xmobar.Run.Exec (start, trigger, alias) import Xmobar.Run.Template @@ -94,14 +95,15 @@ initLoop sig lock vs = do -- | Runs a command as an independent thread and returns its Async handles -- and the TVar the command will be writing to. startCommand :: TMVar SignalType - -> (Runnable,String,String) + -> (Runnable, String, String) -> IO ([Async ()], TVar String) startCommand sig (com,s,ss) | alias com == "" = do var <- newTVarIO is atomically $ writeTVar var (s ++ ss) return ([], var) | otherwise = do var <- newTVarIO is - let cb str = atomically $ writeTVar var (s ++ str ++ ss) + let cb str = atomically $ + writeTVar var (s ++ withEmptyAction str ++ ss) a1 <- async $ start com cb a2 <- async $ trigger com $ maybe (return ()) (atomically . putTMVar sig) |