summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-12-09 01:15:41 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-12-09 01:15:41 +0100
commita708d0defae7db40f01e294be44829e7a2f30be8 (patch)
treea30fea9904a25b7d3eaf77f5a41a2e4ef75dda74
parentf7cbb14d9ee40d07abcde45868507f858e072fdd (diff)
downloadxmobar-a708d0defae7db40f01e294be44829e7a2f30be8.tar.gz
xmobar-a708d0defae7db40f01e294be44829e7a2f30be8.tar.bz2
Network monitor: no units in reported rates
Since they're always KB/s, we left them for the template
-rw-r--r--Plugins/Monitors/Net.hs7
-rw-r--r--Plugins/Monitors/Top.hs2
-rw-r--r--README16
3 files changed, 13 insertions, 12 deletions
diff --git a/Plugins/Monitors/Net.hs b/Plugins/Monitors/Net.hs
index d08f96e..c232b42 100644
--- a/Plugins/Monitors/Net.hs
+++ b/Plugins/Monitors/Net.hs
@@ -28,7 +28,7 @@ interval = 500000
netConfig :: IO MConfig
netConfig = mkMConfig
- "<dev>: <rx>|<tx>" -- template
+ "<dev>: <rx>KB|<tx>KB" -- template
["dev", "rx", "tx", "rxbar", "txbar"] -- available replacements
-- Given a list of indexes, take the indexed elements from a list.
@@ -64,10 +64,9 @@ netParser =
formatNet :: Float -> Monitor (String, String)
formatNet d = do
- b <- showLogBar 0.8 d
- x <- showWithColors f d
+ b <- showLogBar 0.6 d
+ x <- showWithColors (showDigits 1) d
return (x, b)
- where f s = showDigits 1 s ++ "Kb"
printNet :: NetDev -> Monitor String
printNet nd =
diff --git a/Plugins/Monitors/Top.hs b/Plugins/Monitors/Top.hs
index d475204..924d4b6 100644
--- a/Plugins/Monitors/Top.hs
+++ b/Plugins/Monitors/Top.hs
@@ -134,7 +134,7 @@ topProcesses tref scale = do
atomicModifyIORef tref $ \(t0, c0) ->
let scx = realToFrac (diffUTCTime c1 c0) * scale / 100
ts = M.elems $ combineTimeInfos t0 t1
- nts = map (\(nm, t) -> (nm, t / scx)) ts
+ nts = map (\(nm, t) -> (nm, min 100 (t / scx))) ts
in ((t1, c1), (len, sortTop nts, sortTop mis))
showTimeInfo :: TimeInfo -> Monitor [String]
diff --git a/README b/README
index 10c6e9c..a9b5507 100644
--- a/README
+++ b/README
@@ -286,13 +286,15 @@ to run the Memory monitor plugin with the specified template, and the
swap monitor plugin, with default options, every second.
The only internal available command is `Com` (see below Executing
-External Commands). All other commands are provided by plugins.
-xmobar comes with some plugins, providing a set of system monitors,
-a standard input reader, an Unix named pipe reader, and a configurable
+External Commands). All other commands are provided by plugins. xmobar
+comes with some plugins, providing a set of system monitors, a
+standard input reader, an Unix named pipe reader, and a configurable
date plugin. These plugins install the following internal commands:
-`Weather`, `Network`, `Memory`, `Swap`, `Cpu`, `MultiCpu`, `Battery`,
-`Thermal`, `CpuFreq`, `CoreTemp`, `Date`, `StdinReader`,
-`CommandReader`, and `PipeReader`.
+`Weather`, `Network`, `Wireless` (optional), `Memory`, `Swap`, `Cpu`,
+`MultiCpu`, `Battery`, `TopProc`, `TopMem`, `DiskU`, `DiskIO`,
+`Thermal`, `CpuFreq`, `CoreTemp`, `MPD` (optional), `Mail` (optional),
+`MBox` (optional), `Date`, `StdinReader`, `CommandReader`, and
+`PipeReader`.
To remove them see below Installing/Removing a Plugin
@@ -326,7 +328,7 @@ Monitors have default aliases.
- Args: default monitor arguments (see below)
- Variables that can be used with the `-t`/`--template` argument:
`dev`, `rx`, `tx`, `rxbar`, `txbar`
-- Default template: `<dev>: <rx>|<tx>`
+- Default template: `<dev>: <rx>KB|<tx>KB`
`Wireless Interface Args RefreshRate`