From 7ea15612b4255b62725fc2819e6df05d7df3ff07 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 30 May 2020 11:41:29 -0400 Subject: [PATCH] save the file check every time --- .local/bin/statusbar/nettraf | 3 +-- 1 file changed, 1 insertion(+), 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" \