From 19f36a28d501773708da02ba149e8d8dae5756aa Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 13 Dec 2010 00:24:55 +0100 Subject: Use -S in Network to control units display We've made -P a synonym of -S, and renamed the option to useSuffix. --- Plugins/Monitors/Net.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Plugins/Monitors/Net.hs') diff --git a/Plugins/Monitors/Net.hs b/Plugins/Monitors/Net.hs index b17aa44..d9cd534 100644 --- a/Plugins/Monitors/Net.hs +++ b/Plugins/Monitors/Net.hs @@ -12,7 +12,7 @@ -- ----------------------------------------------------------------------------- -module Plugins.Monitors.Net where +module Plugins.Monitors.Net (netConfig, runNet) where import Plugins.Monitors.Common import qualified Data.ByteString.Lazy.Char8 as B @@ -64,8 +64,10 @@ netParser = formatNet :: Float -> Monitor (String, String) formatNet d = do + s <- getConfigValue useSuffix + let str = if s then (++"Kb/s") . showDigits 1 else showDigits 1 b <- showLogBar 0.9 d - x <- showWithColors (showDigits 1) d + x <- showWithColors str d return (x, b) printNet :: NetDev -> Monitor String -- cgit v1.2.3