From dd8da1765a78117219e8b81d0945baa1e66c3a67 Mon Sep 17 00:00:00 2001 From: Future is FOSS <79040025+futureisfoss@users.noreply.github.com> Date: Thu, 23 Sep 2021 21:45:42 +0530 Subject: [PATCH] show red cross if wifi is disabled (#898) show a red cross mark if wifi is disabled/turned off. --- .local/bin/statusbar/sb-internet | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index ee1a160..d3948d7 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -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