summaryrefslogtreecommitdiff
path: root/dwmbar-functions/dwm_vpn.sh
diff options
context:
space:
mode:
Diffstat (limited to 'dwmbar-functions/dwm_vpn.sh')
-rwxr-xr-xdwmbar-functions/dwm_vpn.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/dwmbar-functions/dwm_vpn.sh b/dwmbar-functions/dwm_vpn.sh
new file mode 100755
index 0000000..b57b114
--- /dev/null
+++ b/dwmbar-functions/dwm_vpn.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+# A dwm_bar function to show VPN connections (if any are active)
+# Joe Standring <[email protected]>
+# GNU GPLv3
+
+# Dependencies: NetworkManager-openvpn
+
+dwm_vpn () {
+ VPN=$(nmcli -a | grep 'VPN connection' | sed -e 's/\( VPN connection\)*$//g')
+
+ if [ "$VPN" != "" ]; then
+ printf "%s" "$SEP1"
+ if [ "$IDENTIFIER" = "unicode" ]; then
+ printf "🔒 %s" "$VPN"
+ else
+ printf "VPN %s" "$VPN"
+ fi
+ printf "%s\n" "$SEP2"
+ fi
+}
+
+
+dwm_vpn