summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Run
diff options
context:
space:
mode:
Diffstat (limited to 'src/Xmobar/Run')
-rw-r--r--src/Xmobar/Run/Loop.hs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Xmobar/Run/Loop.hs b/src/Xmobar/Run/Loop.hs
index 30ee112..bda41ff 100644
--- a/src/Xmobar/Run/Loop.hs
+++ b/src/Xmobar/Run/Loop.hs
@@ -16,7 +16,7 @@
--
------------------------------------------------------------------------------
-module Xmobar.Run.Loop (initLoop, loop) where
+module Xmobar.Run.Loop (LoopFunction, loop) where
import Control.Concurrent (forkIO)
import Control.Exception (bracket_, bracket, handle, SomeException(..))
@@ -53,13 +53,10 @@ refreshLockT var action = do
putTMVar var ()
return r
-type StartFunction = TMVar SignalType
- -> TMVar ()
- -> [[([Async ()], TVar String)]]
- -> IO ()
+type LoopFunction = TMVar SignalType -> TVar [String] -> IO ()
-loop :: Config -> StartFunction -> IO ()
-loop conf starter = withDeferSignals $ do
+loop :: Config -> LoopFunction -> IO ()
+loop conf looper = withDeferSignals $ do
cls <- mapM (parseTemplate (commands conf) (sepChar conf))
(splitTemplate (alignSep conf) (template conf))
let confSig = unSignalChan (signal conf)
@@ -70,7 +67,8 @@ loop conf starter = withDeferSignals $ do
bracket (mapM (mapM $ startCommand sig) cls)
cleanupThreads
$ \vars -> do
- starter sig refLock vars
+ tv <- initLoop sig refLock vars
+ looper sig tv
cleanupThreads :: [[([Async ()], a)]] -> IO ()
cleanupThreads vars =