summaryrefslogtreecommitdiff
path: root/.local/bin/waybar-vpn
blob: 9385a029aac9796842f0de0f15d766aa08270860 (plain)
1
2
3
4
5
6
7
8
9
#!/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
	# Hide the module if no vpn connection
	printf ""
fi