diff --git a/lib/Xmobar/Plugins/Common.hs b/lib/Xmobar/Plugins/Common.hs index 2295a81..60c91c2 100644 --- a/lib/Xmobar/Plugins/Common.hs +++ b/lib/Xmobar/Plugins/Common.hs @@ -112,10 +112,16 @@ withDBusClientConnection cb n logfile f = env <- mkSimpleApp lf Nothing runRIO env $ displayMaybe' cb f =<< getDBusClient n --- | Run a plugin action with a new DBus client and logfile path. --- This is necessary for DBus callbacks which run in separate threads, which --- will usually fire when the parent thread already exited and killed off its --- DBus connection and closed its logfile. +-- | Run a plugin action with a new DBus client and logfile path. This is +-- necessary for DBus callbacks which run in separate threads, which will +-- usually fire when the parent thread already exited and killed off its DBus +-- connection and closed its logfile. NOTE: unlike 'withDBusClientConnection' +-- this function will open and new logfile and client connection and close both +-- on completion. 'withDBusClientConnection' will only close the log file but +-- keep the client connection active upon termination; this client will only be +-- killed when the entire process is killed. This distinction is important +-- because callbacks only need ephemeral connections, while listeners (started +-- with 'withDBusClientConnection') need long-lasting connections. withNestedDBusClientConnection :: (MonadUnliftIO m, SafeClient c, MonadReader (PluginEnv s c) m) => Maybe BusName