diff options
Diffstat (limited to '.local/bin/statusbar/sb-nettraf')
-rwxr-xr-x | .local/bin/statusbar/sb-nettraf | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/.local/bin/statusbar/sb-nettraf b/.local/bin/statusbar/sb-nettraf index 2f223d6..ce001b0 100755 --- a/.local/bin/statusbar/sb-nettraf +++ b/.local/bin/statusbar/sb-nettraf @@ -6,21 +6,21 @@ case $BLOCK_BUTTON in 1) setsid -f "$TERMINAL" -e bmon ;; - 3) notify-send "🌐 Network traffic module" "🔻: Traffic received -🔺: Traffic transmitted" ;; + 3) notify-send " Network traffic module" " : Traffic received + : Traffic transmitted" ;; 8) setsid -f "$TERMINAL" -e "$EDITOR" "$0" ;; esac update() { - sum=0 - for arg; do - read -r i < "$arg" - sum=$(( sum + i )) - done - cache=/tmp/${1##*/} - [ -f "$cache" ] && read -r old < "$cache" || old=0 - printf %d\\n "$sum" > "$cache" - printf %d\\n $(( sum - old )) + sum=0 + for arg; do + read -r i < "$arg" + sum=$(( sum + i )) + done + cache=/tmp/${1##*/} + [ -f "$cache" ] && read -r old < "$cache" || old=0 + printf %d\\n "$sum" > "$cache" + printf %d\\n $(( sum - old )) } rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes) |