summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Pan <gky44px1999@gmail.com>2024-03-11 03:13:27 -0700
committerXiao Pan <gky44px1999@gmail.com>2024-03-11 03:13:27 -0700
commit583adac015a32d496e88b3ef05af550fecb5841f (patch)
treefb5a4c830663b28f97eb5b1a565997ac2df34751
parent9f56ff494bc4d621c60574d91dc642ba9aea70b7 (diff)
advanced wireguard
-rwxr-xr-xsh/sbar11
1 files changed, 6 insertions, 5 deletions
diff --git a/sh/sbar b/sh/sbar
index 3779cf5..b12062b 100755
--- a/sh/sbar
+++ b/sh/sbar
@@ -16,10 +16,11 @@ update_time () {
update_net () {
net="$(if nmcli -t --fields type,state device | grep -q '^\(ethernet\|wifi\):connected$'; then echo 1; else echo 0; fi)"
case "$(nmcli -t --fields device,state device)" in
- *wg_ia:connected*) vpn=I;;
- *wg_ka:connected*) vpn=K;;
- *wg_studio:connected*) vpn=S;;
- *) vpn=0;;
+ *wg_ia:connected*) wg=I;;
+ *wg_ka:connected*) wg=K;;
+ *wg_mydefault:connected*) wg=D;;
+ *wg_studio:connected*) wg=S;;
+ *) wg=0;;
esac
}
@@ -42,7 +43,7 @@ update_gpu () {
}
display () {
- xsetroot -name "$time | N $net V $vpn | M $vol C $mic | $gpu | $bat"
+ xsetroot -name "$time | N $net W $wg | M $vol C $mic | $gpu | $bat"
}
# modules that don't update on their own need to be run at the start for getting their initial value