diff options
-rw-r--r-- | readme.md | 9 | ||||
-rw-r--r-- | src/Plugins/Monitors/Disk.hs | 15 |
2 files changed, 16 insertions, 8 deletions
@@ -840,8 +840,9 @@ more than one battery. - Aliases to `disku` - Disks: list of pairs of the form (device or mount point, template), where the template can contain `<size>`, `<free>`, `<used>`, `<freep>` or - `<usedp>`, `<freebar>` or `<usedbar>` for total, free, used, free - percentage and used percentage of the given file system capacity. + `<usedp>`, `<freebar>`, `<freevbar>`, `<usedbar>` or `<usedvbar>` for total, + free, used, free percentage and used percentage of the given file system + capacity. - Args: default monitor arguments. `-t`/`--template` is ignored. - Default template: none (you must specify a template for each file system). - Example: @@ -855,7 +856,9 @@ more than one battery. - Aliases to `diskio` - Disks: list of pairs of the form (device or mount point, template), where the template can contain `<total>`, `<read>`, `<write>` for total, - read and write speed, respectively. + read and write speed, respectively. There are also bar versions of each: + `<totalbar>`, `<totalvbar>`, `<readbar>`, `<readvbar>`, `<writebar>`, and + `<writevbar>`. - Args: default monitor arguments. `-t`/`--template` is ignored. - Default template: none (you must specify a template for each file system). - Example: diff --git a/src/Plugins/Monitors/Disk.hs b/src/Plugins/Monitors/Disk.hs index cf4fa00..e0a7886 100644 --- a/src/Plugins/Monitors/Disk.hs +++ b/src/Plugins/Monitors/Disk.hs @@ -27,12 +27,14 @@ import Data.Maybe (catMaybes) import System.Directory (canonicalizePath, doesFileExist) diskIOConfig :: IO MConfig -diskIOConfig = mkMConfig "" ["total", "read", "write", - "totalbar", "readbar", "writebar"] +diskIOConfig = mkMConfig "" ["total", "read", "write" + ,"totalbar", "readbar", "writebar" + ,"totalvbar", "readvbar", "writevbar" + ] diskUConfig :: IO MConfig diskUConfig = mkMConfig "" - ["size", "free", "used", "freep", "usedp", "freebar", "usedbar"] + ["size", "free", "used", "freep", "usedp", "freebar", "freevbar", "usedbar", "usedvbar"] type DevName = String type Path = String @@ -129,8 +131,9 @@ runDiskIO' :: (String, [Float]) -> Monitor String runDiskIO' (tmp, xs) = do s <- mapM (showWithColors speedToStr) xs b <- mapM (showLogBar 0.8) xs + vb <- mapM (showLogVBar 0.8) xs setConfigValue tmp template - parseTemplate $ s ++ b + parseTemplate $ s ++ b ++ vb runDiskIO :: DevDataRef -> [(String, String)] -> [String] -> Monitor String runDiskIO dref disks _ = do @@ -167,8 +170,10 @@ runDiskU' tmp path = do s <- zipWithM showWithColors' strs [100, 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) - parseTemplate $ s ++ sp ++ [fb, ub] + uvb <- showVerticalBar (fromIntegral $ 100 - freep) (1 - fr) + parseTemplate $ s ++ sp ++ [fb,fvb,ub,uvb] where ign = const (return [0, 0, 0]) :: SomeException -> IO [Integer] |