mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-23 11:53:02 +00:00
9 lines
390 B
Bash
Executable file
9 lines
390 B
Bash
Executable file
#!/usr/bin/env bash
|
|
MAX_DOWN=110000
|
|
MAX_UP=45000
|
|
UPDOWN=$(ifstat -i "en0" -b 0.1 1 | tail -n1)
|
|
DOWN=$(echo $UPDOWN | awk "{ print \$1 }" | cut -f1 -d ".")
|
|
UP=$(echo $UPDOWN | awk "{ print \$2 }" | cut -f1 -d ".")
|
|
|
|
sketchybar -m push network_down $(echo $UPDOWN | awk "{ print \$1 / (1.0 * $MAX_DOWN) }")
|
|
sketchybar -m push network_up $(echo $UPDOWN | awk "{ print \$2 / (1.0 * $MAX_UP) }")
|