diff options
| author | Luke Smith <luke@lukesmith.xyz> | 2020-05-30 11:09:12 -0400 |
|---|---|---|
| committer | Luke Smith <luke@lukesmith.xyz> | 2020-05-30 11:09:12 -0400 |
| commit | d8272650bd675011496b4825160510109e47bba5 (patch) | |
| tree | 808c957fe4f8578c6c65315f7ab7f32c7ae3f6b1 | |
| parent | 884dcbdc4792eed95e558af84491eb3100d314a2 (diff) | |
| download | eibhear-d8272650bd675011496b4825160510109e47bba5.tar.gz eibhear-d8272650bd675011496b4825160510109e47bba5.tar.zst eibhear-d8272650bd675011496b4825160510109e47bba5.zip | |
paste directly on files, excluding lo
| -rwxr-xr-x | .local/bin/statusbar/nettraf | 4 |
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))" \ |
