mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-12-22 18:38:00 +00:00
[polybar] Fix network_usage when a VPN is enabled
This commit is contained in:
parent
1078c005b0
commit
3c634f4870
@ -31,6 +31,10 @@ while true; do
|
||||
now=$(date +%s)
|
||||
counter_age=$(stat --format %Z $COUNTER_FILE 2>/dev/null)
|
||||
|
||||
if [ "$default_device" = "link" ]; then
|
||||
default_device=$(ip route list | grep -Fm 1 default | cut -d " " -f 3)
|
||||
fi
|
||||
|
||||
if [ -f $COUNTER_FILE ] && [ $((now-counter_age)) -lt $((REFRESH+1)) ]; then
|
||||
last_value_in=$(cut -f 1 -d " " $COUNTER_FILE)
|
||||
last_value_out=$(cut -f 2 -d " " $COUNTER_FILE)
|
||||
|
Loading…
Reference in New Issue
Block a user