2012-08-04 19:31:06 +00:00
|
|
|
|
#!/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
|
|
|
|
|
# }
|
|
|
|
|
|
2013-02-26 19:16:47 +00:00
|
|
|
|
i3status | (read line && echo $line && read line && echo $line && while :
|
2012-08-04 19:31:06 +00:00
|
|
|
|
do
|
|
|
|
|
read line
|
|
|
|
|
dat=$(measure-net-speed.bash)
|
|
|
|
|
dat="[{ \"full_text\": \"${dat}\" },"
|
|
|
|
|
echo "${line/[/$dat}" || exit 1
|
|
|
|
|
done)
|