diff options
author | jao <jao@gnu.org> | 2025-02-11 04:40:34 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2025-02-11 11:58:06 +0000 |
commit | 4beda5f4d1067117f2c2786727697f79cf986244 (patch) | |
tree | d3f93ff60771e554648c05ae1a055d50b0b828a9 /src/Xmobar/Run/Loop.hs | |
parent | 7390d759240785f660cbdb0ca55898732aa12c98 (diff) | |
download | xmobar-4beda5f4d1067117f2c2786727697f79cf986244.tar.gz xmobar-4beda5f4d1067117f2c2786727697f79cf986244.tar.bz2 |
prototype for onClick method in Exec
Diffstat (limited to 'src/Xmobar/Run/Loop.hs')
-rw-r--r-- | src/Xmobar/Run/Loop.hs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Xmobar/Run/Loop.hs b/src/Xmobar/Run/Loop.hs index bda41ff..9954cb9 100644 --- a/src/Xmobar/Run/Loop.hs +++ b/src/Xmobar/Run/Loop.hs @@ -3,7 +3,7 @@ ------------------------------------------------------------------------------ -- | -- Module: Xmobar.Run.Loop --- Copyright: (c) 2022 Jose Antonio Ortega Ruiz +-- Copyright: (c) 2022, 2025 Jose Antonio Ortega Ruiz -- License: BSD3-style (see LICENSE) -- -- Maintainer: jao@gnu.org @@ -53,13 +53,14 @@ refreshLockT var action = do putTMVar var () return r -type LoopFunction = TMVar SignalType -> TVar [String] -> IO () +type LoopFunction = [Runnable] -> TMVar SignalType -> TVar [String] -> IO () loop :: Config -> LoopFunction -> IO () loop conf looper = withDeferSignals $ do cls <- mapM (parseTemplate (commands conf) (sepChar conf)) - (splitTemplate (alignSep conf) (template conf)) + (splitTemplate (alignSep conf) (template conf)) let confSig = unSignalChan (signal conf) + runners = map (\(r, _, _) -> r) (concat cls) sig <- maybe newEmptyTMVarIO pure confSig unless (isJust confSig) $ setupSignalHandler sig refLock <- newRefreshLock @@ -68,7 +69,7 @@ loop conf looper = withDeferSignals $ do cleanupThreads $ \vars -> do tv <- initLoop sig refLock vars - looper sig tv + looper runners sig tv cleanupThreads :: [[([Async ()], a)]] -> IO () cleanupThreads vars = |