summaryrefslogtreecommitdiff
path: root/contrib/measure-net-speed-i3status.bash
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2012-08-04 21:31:06 +0200
committerMichael Stapelberg <michael@stapelberg.de>2012-08-04 21:31:06 +0200
commitb61f70b05f192832f9abe54ea59fe08c86dfda21 (patch)
tree3f8dae95d19fb05e0a6319b60823e8ecc068ff61 /contrib/measure-net-speed-i3status.bash
parentdea8703abaf8deb94a1212dde25b211ad8411846 (diff)
Import measure-net-speed bash scripts to contrib/
Diffstat (limited to 'contrib/measure-net-speed-i3status.bash')
-rwxr-xr-xcontrib/measure-net-speed-i3status.bash27
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/measure-net-speed-i3status.bash b/contrib/measure-net-speed-i3status.bash
new file mode 100755
index 0000000..9f9e5ce
--- /dev/null
+++ b/contrib/measure-net-speed-i3status.bash
@@ -0,0 +1,27 @@
+#!/bin/bash
+# Public Domain
+# (someone claimed the next lines would be useful for…
+# people. So here goes: © 2012 Stefan Breunig
+# stefan+measure-net-speed@mathphys.fsk.uni-heidelberg.de)
+
+# append i3status output to the measure-net-speed’s one.
+# the quote and escape magic is required to get valid
+# JSON output, which is expected by i3bar (if you want
+# colors, that is. Otherwise plain text would be fine).
+# For colors, your i3status.conf should contain:
+# general {
+# output_format = i3bar
+# }
+
+# i3 config looks like this:
+# bar {
+# status_command measure-net-speed-i3status.bash
+# }
+
+i3status | (read line && echo $line && while :
+do
+ read line
+ dat=$(measure-net-speed.bash)
+ dat="[{ \"full_text\": \"${dat}\" },"
+ echo "${line/[/$dat}" || exit 1
+done) \ No newline at end of file