summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2020-05-30 11:41:29 -0400
committerLuke Smith <luke@lukesmith.xyz>2020-05-30 11:41:29 -0400
commit7ea15612b4255b62725fc2819e6df05d7df3ff07 (patch)
tree9323d10fd2e6f6c934b746ea8cff489dc785f351 /.local/bin
parent1d95b2210e4935c0dbf5a1ad04fbc9a4739de299 (diff)
downloadeibhear-7ea15612b4255b62725fc2819e6df05d7df3ff07.tar.gz
eibhear-7ea15612b4255b62725fc2819e6df05d7df3ff07.tar.zst
eibhear-7ea15612b4255b62725fc2819e6df05d7df3ff07.zip
save the file check every time
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/statusbar/nettraf3
1 files changed, 1 insertions, 2 deletions
diff --git a/.local/bin/statusbar/nettraf b/.local/bin/statusbar/nettraf
index f6c5779..1de6801 100755
--- a/.local/bin/statusbar/nettraf
+++ b/.local/bin/statusbar/nettraf
@@ -11,10 +11,9 @@ case "$BLOCK_BUTTON" in
esac
logfile="${XDG_CACHE_HOME:-$HOME/.cache}/netlog"
-prevdata="$(cat "$logfile")"
+prevdata="$(cat "$logfile")" || echo "0 0" > "$logfile"
rxcurrent="$(($(paste -d '+' /sys/class/net/[ew]*/statistics/rx_bytes)))"
-[ -f "$logfile" ] || echo "0 0" > "$logfile"
txcurrent="$(($(paste -d '+' /sys/class/net/[^lo]*/statistics/tx_bytes)))"
printf "🔻%sKiB 🔺%sKiB\\n" \