From 49ab20e6360456f8d8fbcdc931406b5cf7bd0cca Mon Sep 17 00:00:00 2001 From: Eric Mrak Date: Sat, 15 Mar 2014 14:56:13 -0700 Subject: Net plugin has txvbar and rxvbar --- src/Plugins/Monitors/Net.hs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/Plugins') diff --git a/src/Plugins/Monitors/Net.hs b/src/Plugins/Monitors/Net.hs index 2117a2d..c2e1cf2 100644 --- a/src/Plugins/Monitors/Net.hs +++ b/src/Plugins/Monitors/Net.hs @@ -53,7 +53,7 @@ instance Ord NetDev where netConfig :: IO MConfig netConfig = mkMConfig ": KB|KB" -- template - ["dev", "rx", "tx", "rxbar", "txbar"] -- available replacements + ["dev", "rx", "tx", "rxbar", "rxvbar", "txbar", "txvbar"] -- available replacements operstateDir :: String -> FilePath operstateDir d = "/sys/class/net" d "operstate" @@ -97,22 +97,23 @@ findNetDev dev = do isDev (NI d) = d == dev isDev NA = False -formatNet :: Float -> Monitor (String, String) +formatNet :: Float -> Monitor (String, String, String) formatNet d = do s <- getConfigValue useSuffix dd <- getConfigValue decDigits let str = if s then (++"Kb/s") . showDigits dd else showDigits dd b <- showLogBar 0.9 d + vb <- showLogVBar 0.9 d x <- showWithColors str d - return (x, b) + return (x, b, vb) printNet :: NetDev -> Monitor String printNet nd = case nd of ND d r t -> do - (rx, rb) <- formatNet r - (tx, tb) <- formatNet t - parseTemplate [d,rx,tx,rb,tb] + (rx, rb, rvb) <- formatNet r + (tx, tb, tvb) <- formatNet t + parseTemplate [d,rx,tx,rb,rvb,tb,tvb] NI _ -> return "" NA -> getConfigValue naString -- cgit v1.2.3