diff options
Diffstat (limited to 'src/Xmobar/Text/Loop.hs')
-rw-r--r-- | src/Xmobar/Text/Loop.hs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Xmobar/Text/Loop.hs b/src/Xmobar/Text/Loop.hs index 5d2c43f..62dd5c8 100644 --- a/src/Xmobar/Text/Loop.hs +++ b/src/Xmobar/Text/Loop.hs @@ -1,7 +1,7 @@ ------------------------------------------------------------------------------ -- | -- Module: Xmobar.Text.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 @@ -24,6 +24,7 @@ import Control.Concurrent.STM import Xmobar.System.Signal import Xmobar.Config.Types (Config) import Xmobar.Run.Loop (loop) +import Xmobar.Run.Runnable (Runnable) import Xmobar.Text.Output (initLoop, format) -- | Starts the main event loop and threads @@ -35,12 +36,12 @@ textLoop conf = do loop conf (eventLoop conf) -- | Continuously wait for a signal from a thread or a interrupt handler -eventLoop :: Config -> TMVar SignalType -> TVar [String] -> IO () -eventLoop cfg signal tv = do +eventLoop :: Config -> [Runnable] -> TMVar SignalType -> TVar [String] -> IO () +eventLoop cfg rs signal tv = do typ <- atomically $ takeTMVar signal case typ of - Wakeup -> updateString cfg tv >>= putStrLn >> eventLoop cfg signal tv - _ -> eventLoop cfg signal tv + Wakeup -> updateString cfg tv >>= putStrLn >> eventLoop cfg rs signal tv + _ -> eventLoop cfg rs signal tv updateString :: Config -> TVar [String] -> IO String updateString conf v = do |