summaryrefslogtreecommitdiffstats
path: root/.local/bin
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2020-05-30 11:09:12 -0400
committerLuke Smith <luke@lukesmith.xyz>2020-05-30 11:09:12 -0400
commitd8272650bd675011496b4825160510109e47bba5 (patch)
tree808c957fe4f8578c6c65315f7ab7f32c7ae3f6b1 /.local/bin
parent884dcbdc4792eed95e558af84491eb3100d314a2 (diff)
downloadeibhear-d8272650bd675011496b4825160510109e47bba5.tar.gz
eibhear-d8272650bd675011496b4825160510109e47bba5.tar.zst
eibhear-d8272650bd675011496b4825160510109e47bba5.zip
paste directly on files, excluding lo
Diffstat (limited to '.local/bin')
-rwxr-xr-x.local/bin/statusbar/nettraf4
1 files changed, 2 insertions, 2 deletions
diff --git a/.local/bin/statusbar/nettraf b/.local/bin/statusbar/nettraf
index 9a81ad2..82305c3 100755
--- a/.local/bin/statusbar/nettraf
+++ b/.local/bin/statusbar/nettraf
@@ -13,8 +13,8 @@ esac
logfile="${XDG_CACHE_HOME:-$HOME/.cache}/netlog"
prevdata="$(cat "$logfile")"
-rxcurrent="$(($(cat /sys/class/net/*/statistics/rx_bytes | paste -sd '+')))"
-txcurrent="$(($(cat /sys/class/net/*/statistics/tx_bytes | paste -sd '+')))"
+rxcurrent="$(($(paste -d '+' /sys/class/net/[ew]*/statistics/rx_bytes)))"
+txcurrent="$(($(paste -d '+' /sys/class/net/[^lo]*/statistics/tx_bytes)))"
printf "🔻%sKiB 🔺%sKiB\\n" \
"$(((rxcurrent-${prevdata%% *})/1024))" \