dotfiles/root/home/bhasher/.config/waybar/scripts/vpn

13 lines
388 B
Plaintext
Raw Permalink Normal View History

2024-02-17 14:31:00 +01:00
#!/usr/bin/env sh
# Check if wireguard VPN is active
if nmcli c show --active | grep -q wireguard; then
echo '{"text": "VPN", "class": "up"}'
2024-02-17 14:31:00 +01:00
# If not, check if the connection named "YapiBiche" is active
elif nmcli c show --active | grep -q "YapiBiche"; then
echo '{"text": "LAN", "class": "up"}'
2024-02-17 14:31:00 +01:00
# If neither is active, return "NO"
else
echo '{"text": "OFF", "class": "down"}'
2024-02-17 14:31:00 +01:00
fi