#!/bin/sh

vpn="$(nmcli -t -f name,type connection show --order name --active 2>/dev/null | grep vpn | head -1 | cut -d ':' -f 1)"

case "$1" in
    --disconnect)
        nmcli con down $vpn
        ;;
    *)
        if [ -n "$vpn" ]; then
                echo "%{F#94e2d5}󰖂%{F-} $vpn"
        else
                echo ""
        fi
        ;;
esac