summaryrefslogtreecommitdiffhomepage
path: root/Plugins/Monitors/Wireless.hs
diff options
context:
space:
mode:
authorJose A Ortega Ruiz <jao@gnu.org>2010-02-22 15:42:26 +0100
committerJose A Ortega Ruiz <jao@gnu.org>2010-02-22 15:42:26 +0100
commit32dc866c396c262d3781e03bdfd1acd2b4a151ee (patch)
treebc6edd435e0e93d94c76c5849b50e56575bb6bb7 /Plugins/Monitors/Wireless.hs
parentfd7de94c92b5d094bd244a06f8b330237ed7e99d (diff)
downloadxmobar-32dc866c396c262d3781e03bdfd1acd2b4a151ee.tar.gz
xmobar-32dc866c396c262d3781e03bdfd1acd2b4a151ee.tar.bz2
Wireless monitor: better boundary checks
Ignore-this: cfb69e10b2eaff6924a2df32b1e51bf0 darcs-hash:20100222144226-748be-f28cbe827c89238074448b23da7ba606f930ceb9.gz
Diffstat (limited to 'Plugins/Monitors/Wireless.hs')
-rw-r--r--Plugins/Monitors/Wireless.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/Plugins/Monitors/Wireless.hs b/Plugins/Monitors/Wireless.hs
index fe81ab8..eb07afe 100644
--- a/Plugins/Monitors/Wireless.hs
+++ b/Plugins/Monitors/Wireless.hs
@@ -24,10 +24,8 @@ runWireless :: [String] -> Monitor String
runWireless (iface:_) = do
wi <- io $ getWirelessInfo iface
let essid = wiEssid wi
- quality = wiQuality wi
+ qlty = wiQuality wi
e = if essid == "" then "N/A" else essid
- q <- if quality >= 0
- then showWithColors show quality
- else showWithColors' "" (0 :: Int)
+ q <- if qlty >= 0 then showWithColors show qlty else showWithPadding ""
parseTemplate [e, q]
runWireless _ = return "" \ No newline at end of file