diff options
author | jao <jao@gnu.org> | 2014-09-05 01:25:18 +0200 |
---|---|---|
committer | jao <jao@gnu.org> | 2014-09-05 01:25:18 +0200 |
commit | 00721a6ff57978cf07dcfe4b7369fe26fe938674 (patch) | |
tree | a25e9d4b919ee23f2e10f18cef8bf90d2dc8b3df /src/Plugins/Monitors | |
parent | 673207baae4a8bdb5fe0122bf95f7f9b4d863587 (diff) | |
download | xmobar-00721a6ff57978cf07dcfe4b7369fe26fe938674.tar.gz xmobar-00721a6ff57978cf07dcfe4b7369fe26fe938674.tar.bz2 |
Fix: not colorizings total size in DiskU (issue #189)
Diffstat (limited to 'src/Plugins/Monitors')
-rw-r--r-- | src/Plugins/Monitors/Disk.hs | 8 |
1 files changed, 4 insertions, 4 deletions
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] |