feat: add vpn icons in statusbar

This commit is contained in:
David JULIEN 2021-04-09 11:20:27 +02:00
parent e2bb1816a5
commit d65d3cbe3a
2 changed files with 6 additions and 3 deletions

View File

@ -12,9 +12,12 @@
# Wifi quality percentage and  icon if ethernet is connected.
wifi="$(grep "^\s*w" /proc/net/wireless | awk '{ printf int($3 * 100 / 70) }')"
[ $wifi -ne 0 ] && printf " 直 %3d%% " $wifi || printf " 睊 --- "
[ $wifi -ne 0 ] && str="$(printf "直 %3d%%" $wifi)" || str="$(printf "睊 ---")"
eth="$(cat /sys/class/net/enp0s25/operstate)"
if [ "up" = "$eth" ]; then
printf " /  "
str="$(printf "%s /  " "$str")"
fi
vpn="$(pidof openvpn)"
[ -n "$vpn" ] && str="$(printf "() %s" "$str")"
printf " %s " "$str"

View File

@ -16,7 +16,7 @@ out="$(transmission-remote --list)"
cntd="$(echo "$out" | grep -e "Downloading" | wc -l)"
cntu="$(echo "$out" | grep -e "Seeding" | wc -l)"
cntud="$(echo "$out" | grep -e "Up & Down" | wc -l)"
cntd="$(expr $ctnd + $cntud)"
cntd="$(expr $cntd + $cntud)"
cntu="$(expr $cntu + $cntud)"
infos="$(echo "$out"| tail -n1)"
spdd="$(echo "$infos" | awk -F " " '{ printf "%.2f", $5/1024 }')"