diff options
author | Jochen Keil <jochen.keil@gmail.com> | 2012-08-12 10:39:08 +0200 |
---|---|---|
committer | Jochen Keil <jochen.keil@gmail.com> | 2012-08-12 10:46:31 +0200 |
commit | 2570b0d756121fb6314de514412b52f648d0fc25 (patch) | |
tree | 110a6e9157d355331f548a3c7deefa94306f2160 /src | |
parent | 8a53271cd677bea3223f7d25eb1f697aa3d96540 (diff) | |
download | xmobar-2570b0d756121fb6314de514412b52f648d0fc25.tar.gz xmobar-2570b0d756121fb6314de514412b52f648d0fc25.tar.bz2 |
Run the DBus/IPC handler only once on program start
The startCommand function is called for every configured plugin. This
results in multiple calls to runIPC. This it not necessary however.
startLoop is a much more appropriate place, since the other signal
handler (checker and eventer) are run here to.
Diffstat (limited to 'src')
-rw-r--r-- | src/Xmobar.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Xmobar.hs b/src/Xmobar.hs index fb0860d..d758301 100644 --- a/src/Xmobar.hs +++ b/src/Xmobar.hs @@ -87,6 +87,9 @@ startLoop xcfg@(XConf _ _ w _ conf) sig vs = do _ <- forkIO (eventer sig `catch` #endif \(SomeException _) -> void (putStrLn "Thread eventer failed")) +#ifdef DBUS + runIPC sig +#endif eventLoop tv xcfg sig where -- Reacts on events from X @@ -195,9 +198,6 @@ startCommand sig (com,s,ss) let cb str = atomically $ writeTVar var (s ++ str ++ ss) h <- forkIO $ start com cb _ <- forkIO $ trigger com ( maybe (return ()) (putMVar sig) ) -#ifdef DBUS - runIPC sig -#endif return (Just h,var) where is = s ++ "Updating..." ++ ss |