summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2011-08-21 21:08:54 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2011-08-21 21:08:54 +0200
commita3e6a4dd6ce4b624b4fad7a3a16a4c985db7b398 (patch)
tree636d16d29c370b8cd5cd3e9681d63f0056042058
parentadbdfbc7aea7e4df7fe8ca4e3fb3fd9685936a26 (diff)
downloadxmobar-a3e6a4dd6ce4b624b4fad7a3a16a4c985db7b398.tar.gz
xmobar-a3e6a4dd6ce4b624b4fad7a3a16a4c985db7b398.tar.bz2
Wireless: treat <quality> as a %, and honor -p (fixes #48)
-rw-r--r--NEWS4
-rw-r--r--src/Plugins/Monitors/Wireless.hs7
2 files changed, 6 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index b01ada9..60d343a 100644
--- a/NEWS
+++ b/NEWS
@@ -10,13 +10,15 @@ _New features_
_Bug fixes_
+ - [issue 48]: The <quality> field of Wireless behaves like a percentage.
- [issue 50]: `MPD` monitor now works with libmpd 0.6.
- Template sections without fields are now correctly displayed.
- Catch errors when reading battery status (Ben Boeckel).
- Compilation issues with ghc 7.x (Sergei Trofimovich).
- Fixes for CoreTemp monitor in new kernels (Norbert Zeh).
-[issue 50]: http://code.google.com/p/xmobar/issues/detail?id=14
+[issue 48]: http://code.google.com/p/xmobar/issues/detail?id=48
+[issue 50]: http://code.google.com/p/xmobar/issues/detail?id=50
## Version 0.13 (March 28, 2011)
diff --git a/src/Plugins/Monitors/Wireless.hs b/src/Plugins/Monitors/Wireless.hs
index 4ac0c10..1b7e890 100644
--- a/src/Plugins/Monitors/Wireless.hs
+++ b/src/Plugins/Monitors/Wireless.hs
@@ -25,10 +25,9 @@ runWireless :: [String] -> Monitor String
runWireless (iface:_) = do
wi <- io $ getWirelessInfo iface
let essid = wiEssid wi
- qlty = wiQuality wi
- fqlty = fromIntegral qlty
+ qlty = fromIntegral $ wiQuality wi
e = if essid == "" then "N/A" else essid
- q <- if qlty >= 0 then showWithColors show qlty else showWithPadding ""
- qb <- showPercentBar fqlty (fqlty / 100)
+ q <- if qlty >= 0 then showPercentWithColors (qlty/100) else showWithPadding ""
+ qb <- showPercentBar qlty (qlty / 100)
parseTemplate [e, q, qb]
runWireless _ = return "" \ No newline at end of file