diff --git a/.local/bin/statusbar/nettraf b/.local/bin/statusbar/nettraf index ac43416..af61d5a 100755 --- a/.local/bin/statusbar/nettraf +++ b/.local/bin/statusbar/nettraf @@ -19,10 +19,10 @@ update() { cache=${XDG_CACHE_HOME:-$HOME/.cache}/${1##*/} [ -f "$cache" ] && read -r old < "$cache" || old=0 printf %d\\n "$sum" > "$cache" - printf %d\\n $(( (sum - old) / 1024 )) + printf %d\\n $(( sum - old )) } rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes) tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes) -printf "🔻%dKiB 🔺%dKiB\\n" "$rx" "$tx" +printf "🔻%4sB 🔺%4sB\\n" $(numfmt --to=iec $rx) $(numfmt --to=iec-i $tx)