show red cross if wifi is disabled (#898)

show a red cross mark if wifi is disabled/turned off.
This commit is contained in:
Future is FOSS 2021-09-23 21:45:42 +05:30 committed by GitHub
parent fb8923b841
commit dd8da1765a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,6 +7,7 @@
case $BLOCK_BUTTON in
1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;;
3) notify-send "🌐 Internet module" "\- Click to connect
❌: wifi disabled
📡: no wifi connection
📶: wifi connection with quality
❎: no ethernet
@ -17,7 +18,7 @@ case $BLOCK_BUTTON in
esac
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
down) wifiicon="📡 " ;;
down) [ "$(cat /sys/class/net/w*/flags)" = "0x1002" ] && wifiicon="❌ " || wifiicon="📡 " ;;
up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;;
esac