summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Plugins
diff options
context:
space:
mode:
authorslotThe <soliditsallgood@tuta.io>2020-01-15 21:50:58 +0100
committerjao <jao@gnu.org>2020-01-16 15:05:22 +0000
commitefb6d6817c092fe08e9b0f1b8a17bddd29d97cdb (patch)
treebbe314b8c56c919ea971693e1ff6b78546a4c666 /src/Xmobar/Plugins
parent1f1f0bd8b811740c84215f9ed4fa5ebd8309a990 (diff)
downloadxmobar-efb6d6817c092fe08e9b0f1b8a17bddd29d97cdb.tar.gz
xmobar-efb6d6817c092fe08e9b0f1b8a17bddd29d97cdb.tar.bz2
Only require http-conduit when absolutely necessary
Diffstat (limited to 'src/Xmobar/Plugins')
-rw-r--r--src/Xmobar/Plugins/Monitors/Common/Types.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Xmobar/Plugins/Monitors/Common/Types.hs b/src/Xmobar/Plugins/Monitors/Common/Types.hs
index 8662ba3..ea61a58 100644
--- a/src/Xmobar/Plugins/Monitors/Common/Types.hs
+++ b/src/Xmobar/Plugins/Monitors/Common/Types.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE CPP #-}
+
------------------------------------------------------------------------------
-- |
-- Module: Xmobar.Plugins.Monitors.Types
@@ -27,7 +29,10 @@ module Xmobar.Plugins.Monitors.Common.Types ( Monitor
import Data.IORef (IORef, modifyIORef, newIORef, readIORef)
import Control.Monad.Reader (ReaderT, ask, liftIO)
+#if defined(WEATHER) || defined(UVMETER)
import Network.HTTP.Conduit (Manager, newManager, tlsManagerSettings)
+#endif
+
type Monitor a = ReaderT MConfig IO a
@@ -56,7 +61,9 @@ data MConfig =
, naString :: IORef String
, maxTotalWidth :: IORef Int
, maxTotalWidthEllipsis :: IORef String
+#if defined(WEATHER) || defined(UVMETER)
, manager :: IORef Manager
+#endif
}
-- | from 'http:\/\/www.haskell.org\/hawiki\/MonadState'
@@ -104,8 +111,12 @@ mkMConfig tmpl exprts =
na <- newIORef "N/A"
mt <- newIORef 0
mtel <- newIORef ""
+#if defined(WEATHER) || defined(UVMETER)
man <- newIORef =<< newManager tlsManagerSettings
return $ MC nc l lc h hc t e p d mn mx mel pc pr bb bf bw up na mt mtel man
+#else
+ return $ MC nc l lc h hc t e p d mn mx mel pc pr bb bf bw up na mt mtel
+#endif
data Opts = HighColor String
| NormalColor String