summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authormichaellilanushoober <30565219+michaellilanushoober@users.noreply.github.com>2017-07-30 17:43:41 +0200
committermichaellilanushoober <30565219+michaellilanushoober@users.noreply.github.com>2017-07-30 17:43:41 +0200
commitf0c265b3b4359e866673954dbcc5a586c7ae51dd (patch)
tree2e6fe4bb0a1680a4297378b2576285a64a76a08f /src
parent4e016c5c2065430d58b1c2a75de524a4adb7dd38 (diff)
downloadxmobar-f0c265b3b4359e866673954dbcc5a586c7ae51dd.tar.gz
xmobar-f0c265b3b4359e866673954dbcc5a586c7ae51dd.tar.bz2
Guard monitor 'Weather' behind flag 'with_weather'
Hide the monitor 'Weather' behind a flag named 'with_weather'. This implies that the dependency on the module 'HTTP' is now optional. The default for 'with_weather' is True since we do not want to break backwards compatibility/user experience. Further moved the effect of the flag with_conduit within the branch of 'with_weather', since that flag only has some effect if 'with_weather' is true.
Diffstat (limited to 'src')
-rw-r--r--src/Plugins/Monitors.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Plugins/Monitors.hs b/src/Plugins/Monitors.hs
index 43068be..873130e 100644
--- a/src/Plugins/Monitors.hs
+++ b/src/Plugins/Monitors.hs
@@ -20,7 +20,9 @@ module Plugins.Monitors where
import Plugins
import Plugins.Monitors.Common (runM, runMD)
+#ifdef WEATHER
import Plugins.Monitors.Weather
+#endif
import Plugins.Monitors.Net
import Plugins.Monitors.Mem
import Plugins.Monitors.Swap
@@ -53,8 +55,7 @@ import Plugins.Monitors.Volume
import Plugins.Monitors.Mpris
#endif
-data Monitors = Weather Station Args Rate
- | Network Interface Args Rate
+data Monitors = Network Interface Args Rate
| DynNetwork Args Rate
| BatteryP Args Args Rate
| BatteryN Args Args Rate Alias
@@ -74,6 +75,9 @@ data Monitors = Weather Station Args Rate
| TopMem Args Rate
| Uptime Args Rate
| CatInt Int FilePath Args Rate
+#ifdef WEATHER
+ | Weather Station Args Rate
+#endif
#ifdef UVMETER
| UVMeter Station Args Rate
#endif
@@ -104,7 +108,9 @@ type Rate = Int
type DiskSpec = [(String, String)]
instance Exec Monitors where
+#ifdef WEATHER
alias (Weather s _ _) = s
+#endif
alias (Network i _ _) = i
alias (DynNetwork _ _) = "dynnetwork"
alias (Thermal z _ _) = z
@@ -148,7 +154,9 @@ instance Exec Monitors where
start (MultiCpu a r) = startMultiCpu a r
start (TopProc a r) = startTop a r
start (TopMem a r) = runM a topMemConfig runTopMem r
+#ifdef WEATHER
start (Weather s a r) = runMD (a ++ [s]) weatherConfig runWeather r weatherReady
+#endif
start (Thermal z a r) = runM (a ++ [z]) thermalConfig runThermal r
start (ThermalZone z a r) =
runM (a ++ [show z]) thermalZoneConfig runThermalZone r