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/Text/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/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 |