diff --git a/polybar/.config/polybar/config b/polybar/.config/polybar/config index fc907c4..28d8552 100644 --- a/polybar/.config/polybar/config +++ b/polybar/.config/polybar/config @@ -443,6 +443,7 @@ click-right = sh ~/.config/polybar/bin/system-usb-udev --unmount & [module/wireguard] type = custom/script exec = ~/.config/polybar/bin/wireguard-status +;This doesn't work when run in the background for some reason click-left = ~/.local/bin/wireguard-switch [settings] diff --git a/wireguard/.local/bin/wireguard-switch b/wireguard/.local/bin/wireguard-switch index 9904385..82e4f95 100755 --- a/wireguard/.local/bin/wireguard-switch +++ b/wireguard/.local/bin/wireguard-switch @@ -8,11 +8,11 @@ STATUS="$(nmcli device status | grep -c wg0)" case $STATUS in 1) - sudo wg-quick down wg0 - notify-send.py -a wireguard --replaces-process wireguard -i network-vpn-offline-symbolic Wireguard "Connection down" + wg-quick down wg0 + notify-send.py -a wireguard --replaces-process wireguard-status -i network-vpn-offline-symbolic Wireguard "Connection down" & ;; *) - sudo wg-quick up wg0 - notify-send.py -a wireguard --replaces-process wireguard -i network-vpn-symbolic Wireguard "Connection up" + wg-quick up wg0 + notify-send.py -a wireguard --replaces-process wireguard-status -i network-vpn-symbolic Wireguard "Connection up" & ;; esac