dotfiles

My dotfiles: zsh, lf, sxiv, i3, ranger, mpd and more
Log | Files | Refs | Submodules | README | LICENSE

commit f11008c619e1746d0d3f25c471343c1591200941
parent be9490155fae85a877d49c7342a8814a184c414d
Author: jamazi <31401744+jamazi@users.noreply.github.com>
Date:   Thu,  2 Jul 2020 17:59:54 +0300

improve speed format (#738)

* improve speed format

Convert network speed into human-readable format using numfmt, this will handle low and high values properly.

* Update nettraf

fix jitter
Diffstat:
M.local/bin/statusbar/nettraf | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 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)