fix: remove '---' when wifi is down

This commit is contained in:
David JULIEN 2021-07-12 17:53:48 +02:00
parent 54e7472882
commit 9ee6d451d6
1 changed files with 2 additions and 2 deletions

View File

@ -12,8 +12,8 @@
# 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 ] && str="$(printf "直 %3d%%" $wifi)" || str="$(printf "睊 ---")"
eth="$(cat /sys/class/net/enp0s25/operstate)"
[ $wifi -ne 0 ] && str="$(printf "直 %3d%%" $wifi)" || str="$(printf "睊")"
eth="$(cat /sys/class/net/eno1/operstate)"
if [ "up" = "$eth" ]; then
str="$(printf "%s /  " "$str")"
fi