summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Plugins/Monitors/Disk.hs
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2024-03-30 18:26:01 +0000
committerjao <jao@gnu.org>2024-03-30 18:26:01 +0000
commit30d226ba5eca8847775d03403367dee1f1e3dcfc (patch)
treeb62d0f7f176f9f2b58d66866c3c6afb581334bd6 /src/Xmobar/Plugins/Monitors/Disk.hs
parent3f4ae1034fe7575df05c59dd0c357fd448198594 (diff)
downloadxmobar-30d226ba5eca8847775d03403367dee1f1e3dcfc.tar.gz
xmobar-30d226ba5eca8847775d03403367dee1f1e3dcfc.tar.bz2
fix for unmet pattern matches warnings (clean build)
Diffstat (limited to 'src/Xmobar/Plugins/Monitors/Disk.hs')
-rw-r--r--src/Xmobar/Plugins/Monitors/Disk.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Xmobar/Plugins/Monitors/Disk.hs b/src/Xmobar/Plugins/Monitors/Disk.hs
index 47d1eac..95bcff6 100644
--- a/src/Xmobar/Plugins/Monitors/Disk.hs
+++ b/src/Xmobar/Plugins/Monitors/Disk.hs
@@ -1,7 +1,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Plugins.Monitors.Disk
--- Copyright : (c) 2010, 2011, 2012, 2014, 2018, 2019 Jose A Ortega Ruiz
+-- Copyright : (c) 2010-2012, 2014, 2018, 2019, 2024 Jose A Ortega Ruiz
-- License : BSD-style (see LICENSE)
--
-- Maintainer : Jose A Ortega Ruiz <jao@gnu.org>
@@ -131,10 +131,9 @@ startDiskIO disks args rate cb = do
runM args diskIOConfig (runDiskIO dref disks) rate cb
runDiskU' :: DiskUOpts -> String -> [Integer] -> Monitor String
-runDiskU' opts tmp stat = do
+runDiskU' opts tmp (total:free:diff:_) = do
setConfigValue tmp template
- let [total, free, diff] = stat
- strs = map sizeToStr [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 [freep, 100 - freep]
@@ -146,6 +145,7 @@ runDiskU' opts tmp stat = do
uvb <- showVerticalBar (fromIntegral $ 100 - freep) (1 - fr)
uipat <- showIconPattern (usedIconPattern opts) (1 - fr)
parseTemplate $ [sizeToStr total] ++ s ++ sp ++ [fb,fvb,fipat,ub,uvb,uipat]
+runDiskU' _ _ _ = return ""
runDiskU :: [(String, String)] -> [String] -> Monitor String
runDiskU disks argv = do