summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xhome/xyz/.local/bin/sbar13
1 files changed, 11 insertions, 2 deletions
diff --git a/home/xyz/.local/bin/sbar b/home/xyz/.local/bin/sbar
index 461d83ac..182f451d 100755
--- a/home/xyz/.local/bin/sbar
+++ b/home/xyz/.local/bin/sbar
@@ -14,8 +14,17 @@ update_time () {
#}
update_net () {
- net="$(if nmcli -t --fields type,state device | grep -q '\(ethernet\|wifi\):connected'; then echo 1; else echo 0; fi)"
- vpn="$(if nmcli -t --fields type,state device | grep -q '\(tun\|wireguard\):connected'; then echo 1; else echo 0; fi)"
+ net="$(if nmcli -t --fields type,state device | grep -q '^\(ethernet\|wifi\):connected$'; then echo 1; else echo 0; fi)"
+ nm_device_state="$(nmcli -t --fields device,state device)"
+ vpn="$(
+ if echo "$nm_device_state" | grep -q '^wg_ka:connected$'; then
+ echo k
+ elif echo "$nm_device_state" | grep -q '^wg_studio:connected$'; then
+ echo s
+ else
+ echo 0
+ fi
+ )"
}
update_vol () {