From b5da5b662ac4516a762d086d03af90f71665f71d Mon Sep 17 00:00:00 2001 From: MineralwaterXu Date: Tue, 1 Dec 2020 22:24:45 +0800 Subject: autostart and dwmstatus --- dwmbar-functions/dwm_vpn.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 dwmbar-functions/dwm_vpn.sh (limited to 'dwmbar-functions/dwm_vpn.sh') 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 +# 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 -- cgit v1.2.1