summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2014-09-05 01:25:18 +0200
committerjao <jao@gnu.org>2014-09-05 01:25:18 +0200
commit00721a6ff57978cf07dcfe4b7369fe26fe938674 (patch)
treea25e9d4b919ee23f2e10f18cef8bf90d2dc8b3df
parent673207baae4a8bdb5fe0122bf95f7f9b4d863587 (diff)
downloadxmobar-00721a6ff57978cf07dcfe4b7369fe26fe938674.tar.gz
xmobar-00721a6ff57978cf07dcfe4b7369fe26fe938674.tar.bz2
Fix: not colorizings total size in DiskU (issue #189)
-rw-r--r--news.md6
-rw-r--r--src/Plugins/Monitors/Disk.hs8
2 files changed, 10 insertions, 4 deletions
diff --git a/news.md b/news.md
index bce6f2b..27e2e45 100644
--- a/news.md
+++ b/news.md
@@ -15,6 +15,12 @@ _New features_
- Icons can now be also xpm files (if xmobar is compiled with
`with_xpm`), thanks to Alexander Shabalin.
+_Bug fixes_
+
+ - Not colorizing total disk size in `DiskU` ([issue #189]).
+
+[issue #189]: https://github.com/jaor/xmobar/issues/89
+
## Version 0.21 (Jul 1, 2014)
_New features_
diff --git a/src/Plugins/Monitors/Disk.hs b/src/Plugins/Monitors/Disk.hs
index 4cc2865..b43aede 100644
--- a/src/Plugins/Monitors/Disk.hs
+++ b/src/Plugins/Monitors/Disk.hs
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Plugins.Monitors.Disk
--- Copyright : (c) 2010, 2011, 2012 Jose A Ortega Ruiz
+-- Copyright : (c) 2010, 2011, 2012, 2014 Jose A Ortega Ruiz
-- License : BSD-style (see LICENSE)
--
-- Maintainer : Jose A Ortega Ruiz <jao@gnu.org>
@@ -164,16 +164,16 @@ runDiskU' :: String -> String -> Monitor String
runDiskU' tmp path = do
setConfigValue tmp template
[total, free, diff] <- io (handle ign $ fsStats path)
- let strs = map sizeToStr [total, free, diff]
+ let strs = map sizeToStr [free, diff]
freep = if total > 0 then free * 100 `div` total else 0
fr = fromIntegral freep / 100
- s <- zipWithM showWithColors' strs [100, freep, 100 - freep]
+ s <- zipWithM showWithColors' strs [freep, 100 - freep]
sp <- showPercentsWithColors [fr, 1 - fr]
fb <- showPercentBar (fromIntegral freep) fr
fvb <- showVerticalBar (fromIntegral freep) fr
ub <- showPercentBar (fromIntegral $ 100 - freep) (1 - fr)
uvb <- showVerticalBar (fromIntegral $ 100 - freep) (1 - fr)
- parseTemplate $ s ++ sp ++ [fb,fvb,ub,uvb]
+ parseTemplate $ [sizeToStr total] ++ s ++ sp ++ [fb,fvb,ub,uvb]
where ign = const (return [0, 0, 0]) :: SomeException -> IO [Integer]