fix for no wifi, use case statement
This commit is contained in:
parent
f08f4b0b7f
commit
14fde603b7
1 changed files with 5 additions and 3 deletions
|
@ -13,7 +13,9 @@ case $BLOCK_BUTTON in
|
||||||
" ;;
|
" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
grep -q "down" /sys/class/net/w*/operstate && wifiicon="📡" ||
|
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
|
||||||
wifiicon="$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }')"
|
down) wifiicon="📡 " ;;
|
||||||
|
up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;;
|
||||||
|
esac
|
||||||
|
|
||||||
printf "%s %s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate)"
|
printf "%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)"
|
||||||
|
|
Loading…
Reference in a new issue