fix: remove '---' when wifi is down
This commit is contained in:
parent
54e7472882
commit
9ee6d451d6
@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
# Wifi quality percentage and icon if ethernet is connected.
|
# Wifi quality percentage and icon if ethernet is connected.
|
||||||
wifi="$(grep "^\s*w" /proc/net/wireless | awk '{ printf int($3 * 100 / 70) }')"
|
wifi="$(grep "^\s*w" /proc/net/wireless | awk '{ printf int($3 * 100 / 70) }')"
|
||||||
[ $wifi -ne 0 ] && str="$(printf "直 %3d%%" $wifi)" || str="$(printf "睊 ---")"
|
[ $wifi -ne 0 ] && str="$(printf "直 %3d%%" $wifi)" || str="$(printf "睊")"
|
||||||
eth="$(cat /sys/class/net/enp0s25/operstate)"
|
eth="$(cat /sys/class/net/eno1/operstate)"
|
||||||
if [ "up" = "$eth" ]; then
|
if [ "up" = "$eth" ]; then
|
||||||
str="$(printf "%s / " "$str")"
|
str="$(printf "%s / " "$str")"
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user