summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorEric Mrak <mail@ericmrak.info>2014-03-15 14:56:13 -0700
committerEric Mrak <mail@ericmrak.info>2014-03-15 14:56:13 -0700
commit49ab20e6360456f8d8fbcdc931406b5cf7bd0cca (patch)
treec5fb9c953fbee7ef534f0198b4f45a52c64dee1e /src
parent2992cab82cbc1a30c6cdf2195b67a418bf63f8e9 (diff)
downloadxmobar-49ab20e6360456f8d8fbcdc931406b5cf7bd0cca.tar.gz
xmobar-49ab20e6360456f8d8fbcdc931406b5cf7bd0cca.tar.bz2
Net plugin has txvbar and rxvbar
Diffstat (limited to 'src')
-rw-r--r--src/Plugins/Monitors/Net.hs13
1 files changed, 7 insertions, 6 deletions
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
"<dev>: <rx>KB|<tx>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