diff --git a/config.yml b/config.yml new file mode 100644 index 0000000..5b2c542 --- /dev/null +++ b/config.yml @@ -0,0 +1,116 @@ +runcharts: + - title: Search engine response time + position: [[0, 2], [45, 11]] + rate-ms: 500 + triggers: + - title: Latency threshold exceeded + condition: echo "$prev < 0.8 && $cur > 0.8" |bc -l + actions: + terminal-bell: true + sound: true + visual: true + script: 'say alert: ${label} latency exceeded ${cur} second' + legend: + enabled: true + details: false + scale: 2 + items: + - label: GOOGLE + color: 178 + sample: curl -o /dev/null -s -w '%{time_total}' https://www.google.com + - label: YAHOO + sample: curl -o /dev/null -s -w '%{time_total}' https://search.yahoo.com + - label: BING + sample: curl -o /dev/null -s -w '%{time_total}' https://www.bing.com +barcharts: + - title: Local network activity + position: [[45, 20], [35, 10]] + rate-ms: 500 + scale: 0 + items: + - label: UDP bytes in + sample: nettop -J bytes_in -l 1 -m udp | awk '{sum += $4} END {print sum}' + - label: UDP bytes out + sample: nettop -J bytes_out -l 1 -m udp | awk '{sum += $4} END {print sum}' + - label: TCP bytes in + sample: nettop -J bytes_in -l 1 -m tcp | awk '{sum += $4} END {print sum}' + - label: TCP bytes out + sample: nettop -J bytes_out -l 1 -m tcp | awk '{sum += $4} END {print sum}' +gauges: + - title: YEAR PROGRESS + position: [[45, 0], [35, 2]] + cur: + sample: date +%j + max: + sample: echo 365 + min: + sample: echo 0 + - title: DAY PROGRESS + position: [[45, 3], [35, 2]] + cur: + sample: date +%H + max: + sample: echo 24 + min: + sample: echo 0 + - title: HOUR PROGRESS + position: [[45, 6], [35, 2]] + cur: + sample: date +%M + max: + sample: echo 60 + min: + sample: echo 0 + - title: MINUTE PROGRESS + position: [[45, 9], [35, 2]] + triggers: + - title: CLOCK BELL EVERY MINUTE + condition: '[ $label == "cur" ] && [ $cur -eq 0 ] && echo 1 || echo 0' + actions: + sound: true + script: say -v samantha `date +%I:%M%p` + cur: + sample: date +%S + max: + sample: echo 60 + min: + sample: echo 0 +sparklines: + - title: CPU usage + position: [[0, 20], [22, 8]] + rate-ms: 200 + scale: 0 + sample: ps -A -o %cpu | awk '{s+=$1} END {print s}' + - title: Free memory pages + position: [[22, 20], [23, 8]] + rate-ms: 200 + scale: 0 + sample: memory_pressure | grep 'Pages free' | awk '{print $3}' +textboxes: + - title: Docker containers stats + position: [[0, 29], [45, 10]] + rate-ms: 500 + sample: docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.PIDs}}" + - title: Local weather + position: [[69, 32], [13, 8]] + rate-ms: 10000 + sample: curl wttr.in?0ATQF + border: false + - title: New York weather + position: [[45, 32], [13, 8]] + rate-ms: 10000 + sample: curl wttr.in/newyork?0ATQF + transform: echo 1 + border: false + - title: San Francisco weather + position: [[56, 32], [13, 8]] + rate-ms: 10000 + sample: curl wttr.in/sanfrancisco?0ATQF + border: false +asciiboxes: + - title: UTC time + position: [[16, 13], [35, 8]] + rate-ms: 500 + sample: env TZ=UTC date +%r + border: false + font: 3d diff --git a/go.mod b/go.mod index a92edee..b98b79d 100644 --- a/go.mod +++ b/go.mod @@ -11,16 +11,13 @@ require ( github.com/lunixbochs/vtclean v1.0.0 github.com/mattn/go-runewidth v0.0.4 github.com/mbndr/figlet4go v0.0.0-20190224160619-d6cef5b186ea - gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22 + gopkg.in/yaml.v3 v3.0.1 ) require ( github.com/cjbassi/drawille-go v0.0.0-20190126131713-27dc511fe6fd // indirect github.com/gopherjs/gopherjs v0.0.0-20180628210949-0892b62f0d9f // indirect github.com/gopherjs/gopherwasm v0.1.1 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d // indirect - golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045 // indirect - gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 // indirect ) diff --git a/go.sum b/go.sum index d4d2ab0..f5fd6ed 100644 --- a/go.sum +++ b/go.sum @@ -12,8 +12,6 @@ github.com/hajimehoshi/oto v0.1.1 h1:EG+WxxeAfde1mI0adhLYvGbKgDCxm7bCTd6g+JIA6vI github.com/hajimehoshi/oto v0.1.1/go.mod h1:hUiLWeBQnbDu4pZsAhOnGqMI1ZGibS6e2qhQdfpwz04= github.com/jessevdk/go-flags v1.4.0 h1:4IU2WS7AumrZ/40jfhf4QVDMsQwqA7VEHozFRrGARJA= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/kr/pty v1.1.4 h1:5Myjjh3JY/NaAi4IsUbHADytDyl1VE1Y9PXDlL+P/VQ= -github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5 h1:hyz3dwM5QLc1Rfoz4FuWJQG5BN7tc6K1MndAUnGpQr4= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/lunixbochs/vtclean v1.0.0 h1:xu2sLAri4lGiovBDQKxl5mrXyESr3gUr5m5SM5+LVb8= @@ -23,8 +21,6 @@ github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/ github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mbndr/figlet4go v0.0.0-20190224160619-d6cef5b186ea h1:mQncVDBpKkAecPcH2IMGpKUQYhwowlafQbfkz2QFqkc= github.com/mbndr/figlet4go v0.0.0-20190224160619-d6cef5b186ea/go.mod h1:QzTGLGoOqLHUBK8/EZ0v4Fa4CdyXmdyRwCHcl0YbeO4= -github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= -github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= @@ -33,6 +29,5 @@ github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d/go.mod h1:IuKpRQcYE golang.org/x/arch v0.0.0-20181203225421-5a4828bb7045/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v3 v3.0.0-20190502103701-55513cacd4ae/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22 h1:0efs3hwEZhFKsCoP8l6dDB1AZWMgnEl3yWXWRZTOaEA= -gopkg.in/yaml.v3 v3.0.0-20190709130402-674ba3eaed22/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=