home/config/polybar/scripts/vpn-networkmanager-status.sh

10 lines
194 B
Bash
Raw Normal View History

2020-11-17 13:58:04 +01:00
#!/bin/sh
vpn="$(nmcli -t -f name,type connection show --order name --active 2>/dev/null | grep vpn | head -1 | cut -d ':' -f 1)"
if [ -n "$vpn" ]; then
echo "$vpn"
else
echo ""
fi