From 63d5ec3f7d8f7554123f8c0ed9befc02999cb7f1 Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Sun, 5 Jul 2020 21:18:44 +0200 Subject: [PATCH] added wireless symbol to bar if wireless is connected Signed-off-by: Miles Alan --- scripts/core/sxmo_statusbar.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/core/sxmo_statusbar.sh b/scripts/core/sxmo_statusbar.sh index 47e7dad..feff352 100755 --- a/scripts/core/sxmo_statusbar.sh +++ b/scripts/core/sxmo_statusbar.sh @@ -17,6 +17,13 @@ update() { CALLSECONDS="$(echo "$NOWS" - "$CALLSTARTS" | bc)" CALLINFO=" ${CALLSECONDS}s " fi + + # W symbol if wireless is connect + WIRELESS="" + WLANSTATE="$(tr -d "\n" < /sys/class/net/wlan0/operstate)" + if [ "$WLANSTATE" = "up" ]; then + WIRELESS="W " + fi # M symbol if modem monitoring is on & modem present MODEMMON="" @@ -42,7 +49,7 @@ update() { # Time TIME="$(date +%R)" - BAR="${CALLINFO}${MODEMMON}${VOL} ${BATSTATUS}${PCT}% ${TIME}" + BAR="${CALLINFO}${MODEMMON}${WIRELESS}${VOL} ${BATSTATUS}${PCT}% ${TIME}" xsetroot -name "$BAR" }