summaryrefslogtreecommitdiff
path: root/.local/bin/waybar-vpn
blob: f746aec0005937a3bcaaf0f9df107a0565903fe0 (plain)
1
2
3
4
5
6
7
8
#!/bin/sh

vpn=$(nmcli connection show --active | rg -i 'wireguard' | awk '{print $1}')
if [ -n "$vpn" ]; then
	printf "{\"text\": \"$vpn\", \"class\": \"wireguard\", \"alt\": \"disconnected\" }\n"
else
	printf "{\"text\": \"DC'D\", \"class\": \"wireguard\", \"alt\": \"disconnected\" }\n"
fi