Fixed wifi blocklet coloring
This commit is contained in:
parent
f73b483d9d
commit
19e515da29
1 changed files with 7 additions and 7 deletions
|
@ -8,18 +8,18 @@ INTERFACE="${BLOCK_INSTANCE:-wlan0}"
|
||||||
|
|
||||||
[[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && echo 📡 && exit
|
[[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && echo 📡 && exit
|
||||||
|
|
||||||
QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')
|
QUALITY=$(grep $INTERFACE /proc/net/wireless | awk '{ print int($3 * 100 / 70 - 1) }')
|
||||||
|
|
||||||
echo 📶 $QUALITY%
|
echo 📶 $QUALITY%
|
||||||
echo 📶 $QUALITY%
|
echo 📶 $QUALITY%
|
||||||
|
|
||||||
# color
|
# color
|
||||||
if [[ $QUALITY -ge 80 ]]; then
|
if [[ $QUALITY -ge 80 ]]; then
|
||||||
echo "#00FF00"
|
echo "#00FF00"
|
||||||
elif [[ $QUALITY -lt 80 ]]; then
|
|
||||||
echo "#FFF600"
|
|
||||||
elif [[ $QUALITY -lt 60 ]]; then
|
|
||||||
echo "#FFAE00"
|
|
||||||
elif [[ $QUALITY -lt 40 ]]; then
|
elif [[ $QUALITY -lt 40 ]]; then
|
||||||
echo "#FF0000"
|
echo "#FF0000"
|
||||||
|
elif [[ $QUALITY -lt 60 ]]; then
|
||||||
|
echo "#FF8000"
|
||||||
|
elif [[ $QUALITY -lt 80 ]]; then
|
||||||
|
echo "#FFF600"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue