diff options
Diffstat (limited to 'dot_config/waybar/executable_vpn-status.sh')
| -rw-r--r-- | dot_config/waybar/executable_vpn-status.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/dot_config/waybar/executable_vpn-status.sh b/dot_config/waybar/executable_vpn-status.sh new file mode 100644 index 0000000..37fea84 --- /dev/null +++ b/dot_config/waybar/executable_vpn-status.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Waybar custom/vpn module: report whether the wireguard interface +# (managed by systemd-networkd) is admin-up. Output is a single line of +# JSON so waybar can style it via the .up / .down classes. + +iface=hodor + +if ip link show "$iface" 2>/dev/null | grep -qE '<[^>]*\<UP\>'; then + printf '{"text":"VPN","class":"up","tooltip":"%s up"}\n' "$iface" +else + printf '{"text":"VPN","class":"down","tooltip":"%s down"}\n' "$iface" +fi |
