We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent af99ed6 commit bdf39b9Copy full SHA for bdf39b9
wifi/wifi
@@ -22,8 +22,15 @@ fi
22
23
# As per #36 -- It is transparent: e.g. if the machine has no battery or wireless
24
# connection (think desktop), the corresponding block should not be displayed.
25
-[[ ! -d /sys/class/net/${INTERFACE}/wireless ]] ||
26
- [[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]] && exit
+[[ ! -d /sys/class/net/${INTERFACE}/wireless ]] && exit
+
27
+# If the wifi interface exists but no connection is active, "down" shall be displayed.
28
+if [[ "$(cat /sys/class/net/$INTERFACE/operstate)" = 'down' ]]; then
29
+ echo "down"
30
31
+ echo "#FF0000"
32
+ exit
33
+fi
34
35
#------------------------------------------------------------------------
36
0 commit comments