diff options
Diffstat (limited to 'src/Xmobar/App/Main.hs')
-rw-r--r-- | src/Xmobar/App/Main.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Xmobar/App/Main.hs b/src/Xmobar/App/Main.hs index 3240df9..6eda49a 100644 --- a/src/Xmobar/App/Main.hs +++ b/src/Xmobar/App/Main.hs @@ -15,7 +15,7 @@ ------------------------------------------------------------------------------ -module Xmobar.App.Main (xmobar, xmobarMain) where +module Xmobar.App.Main (xmobar, xmobarMain, configFromArgs) where import Control.Concurrent.Async (Async, cancel) import Control.Exception (bracket) @@ -39,7 +39,7 @@ import Xmobar.Run.Template import Xmobar.X11.Types import Xmobar.X11.Text import Xmobar.X11.Window -import Xmobar.App.Opts +import Xmobar.App.Opts (recompileFlag, verboseFlag, getOpts, doOpts) import Xmobar.App.EventLoop (startLoop, startCommand) import Xmobar.App.Compile (recompile, trace) import Xmobar.App.Config @@ -62,6 +62,9 @@ xmobar conf = withDeferSignals $ do ts = textOffsets conf ++ replicate (length fl) (-1) startLoop (XConf d r w (fs:fl) (to:ts) ic conf) sig vars +configFromArgs :: Config -> IO Config +configFromArgs cfg = getArgs >>= getOpts >>= doOpts cfg . fst + cleanupThreads :: [[([Async ()], a)]] -> IO () cleanupThreads vars = for_ (concat vars) $ \(asyncs, _) -> |