diff options
author | jao <jao@gnu.org> | 2025-02-11 04:40:34 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2025-02-11 19:23:53 +0000 |
commit | af4390e1f9152ba1bd3142a5ce5b63313e9747f9 (patch) | |
tree | 16a57104d7700a88b5e9f83f46831530ba2729ce /src/Xmobar/Text | |
parent | 7390d759240785f660cbdb0ca55898732aa12c98 (diff) | |
download | xmobar-af4390e1f9152ba1bd3142a5ce5b63313e9747f9.tar.gz xmobar-af4390e1f9152ba1bd3142a5ce5b63313e9747f9.tar.bz2 |
prototype for onClick method in Exec
Diffstat (limited to 'src/Xmobar/Text')
-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 |