diff options
author | awy <awy@tutamail.com> | 2024-08-27 17:36:26 +0300 |
---|---|---|
committer | awy <awy@tutamail.com> | 2024-08-27 17:36:26 +0300 |
commit | fd953c5191677355b789ea636f61de5a83fbf38c (patch) | |
tree | 1d4c45e6ffa8590fe2511f4ca7f5f8374c5781b5 /.local/bin/statusbar/sb-nettraf | |
parent | 427dc591da83a94e352840c335ea41b96983e7e4 (diff) |
stuff
Diffstat (limited to '.local/bin/statusbar/sb-nettraf')
-rwxr-xr-x | .local/bin/statusbar/sb-nettraf | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/.local/bin/statusbar/sb-nettraf b/.local/bin/statusbar/sb-nettraf index 88df9bd..c9aa417 100755 --- a/.local/bin/statusbar/sb-nettraf +++ b/.local/bin/statusbar/sb-nettraf @@ -16,7 +16,15 @@ update() { printf %d\\n $(( sum - old )) } -rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes) -tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes) - -printf "🔻%4sB 🔺%4sB\\n" $(numfmt --to=iec $rx $tx) +if [ ! -n "$1" ]; then + rx=$(update /sys/class/net/[ew]*/statistics/rx_bytes) + tx=$(update /sys/class/net/[ew]*/statistics/tx_bytes) + printf "🔻%4sB 🔺%4sB\\n" $(numfmt --to=iec $rx $tx) +else + if [ "$1" -eq 1 ]; then + hyprctl dispatch exec "[float; size 1800 1300;]" 'kitty -e sh -c "bmon"' + elif [ "$1" -eq 3 ]; then + notify-send "🌐 Network traffic module" "🔻: Traffic received +🔺: Traffic transmitted" + fi +fi |