I currently live in a bit of an electromagnetic hole. I make do with an antenna on the roof, an amplifier, and a SIM router.
Luckily, I get unlimited data and a double SIM for just over €20 a month, so it's OK... except the connection is... haphazard. Most of the time it's good, but not all.
So, rather than wondering whether "it's me or them", I have a little "connection monitor" in a corner of the screen.
It looks like this:
It consists of two parts: a little shell script that pings four hosts every ten seconds (each) and a conky that displays the results.
They are both eminently editable to fit one's needs/preferences.
The script:
The conky (relevant bit) :
/6 is an arbitrary divider I use to get a number between 1 and 100 most of the time (what conky requires) with the ping times I get here.
Suggestions welcome :·)
[EDIT I tried triple pinging and getting the average, but awk made a hash of it half the time :·/
Luckily, I get unlimited data and a double SIM for just over €20 a month, so it's OK... except the connection is... haphazard. Most of the time it's good, but not all.
So, rather than wondering whether "it's me or them", I have a little "connection monitor" in a corner of the screen.
It looks like this:
It consists of two parts: a little shell script that pings four hosts every ten seconds (each) and a conky that displays the results.
They are both eminently editable to fit one's needs/preferences.
The script:
Code:
#!/bin/bash while : do ping -c 1 -U 1.1.1.1 | awk '/64/ {print substr($7,6,3)}' > /home/not/.local/bin/pp1.txt sleep 10 ping -c 1 -U 8.8.4.4 | awk '/64/ {print substr($7,6,3)}' > /home/not/.local/bin/pp2.txt sleep 10 ping -c 1 -U 104.20.219.35 | awk '/64/ {print substr($7,6,3)}' > /home/not/.local/bin/pp3.txt sleep 10 ping -c 1 -U 130.206.13.20 | awk '/64/ {print substr($7,6,3)}' > /home/not/.local/bin/pp4.txt sleep 10 done
Code:
${color5}${execbar cat /home/not/.local/bin/pp1.txt | awk '// {print $1/6}'} ${voffset -13}${alignr}CFLR ${exec cat /home/not/.local/bin/pp1.txt} # ${execbar cat /home/not/.local/bin/pp2.txt | awk '// {print $1/6}'} ${voffset -13}${alignr}GOOG ${exec cat /home/not/.local/bin/pp2.txt} # ${color5}${execbar cat /home/not/.local/bin/pp3.txt | awk '// {print $1/6}'} ${voffset -13}${alignr}M247 ${exec cat /home/not/.local/bin/pp3.txt} # ${color5}${execbar cat /home/not/.local/bin/pp4.txt | awk '// {print $1/6}'} ${voffset -13}${alignr}IRIS ${exec cat /home/not/.local/bin/pp4.txt}
Suggestions welcome :·)
[EDIT I tried triple pinging and getting the average, but awk made a hash of it half the time :·/
Comment