From 83d27eec2d2a1ea14531324e45af7ce5e2670de2 Mon Sep 17 00:00:00 2001 From: Sam Bowlby Date: Mon, 5 Apr 2021 08:43:39 -0500 Subject: [PATCH] add VPN/Wireguard symbol to statusbar Signed-off-by: Maarten van Gompel --- scripts/core/sxmo_statusbar.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/core/sxmo_statusbar.sh b/scripts/core/sxmo_statusbar.sh index bb97829..776b6cf 100755 --- a/scripts/core/sxmo_statusbar.sh +++ b/scripts/core/sxmo_statusbar.sh @@ -20,6 +20,16 @@ update() { CALLSECONDS="$(echo "$NOWS" - "$CALLSTARTS" | bc)" CALLINFO="${CALLSECONDS}s" fi + + # symbol if wireguard/vpn is connected + VPN="" + VPNDEVICE="$(nmcli con show | grep vpn | awk '{ print $4 }')" + WGDEVICE="$(nmcli con show | grep wireguard | awk '{ print $4 }')" + if [ -n "$VPNDEVICE" ] && [ "$VPNDEVICE" != "--" ]; then + VPN=" " + elif [ -n "$WGDEVICE" ] && [ "$WGDEVICE" != "--" ]; then + VPN=" " + fi # W symbol if wireless is connect WIRELESS="" @@ -121,7 +131,7 @@ update() { # Time TIME="$(date +%R)" - BAR="${CALLINFO} ${MODEMMON} ${WIRELESS} ${AUDIOSYMBOL}${VOLUMESYMBOL} ${BATSTATUS} ${TIME}" + BAR="$(echo "${CALLINFO} ${MODEMMON} ${WIRELESS} ${VPN} ${AUDIOSYMBOL}${VOLUMESYMBOL} ${BATSTATUS} ${TIME}" | sed 's| \+| |g')" xsetroot -name "$BAR" }