summaryrefslogtreecommitdiffstats
path: root/.local
diff options
context:
space:
mode:
Diffstat (limited to '.local')
-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" \