From bdbd07823796973d11536dc05dc1cf7bb11f2341 Mon Sep 17 00:00:00 2001 From: Benjamin Chausse Date: Mon, 26 Oct 2020 00:38:53 -0400 Subject: moving to pia as a vpn provider --- .local/bin/vpnmenu | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to '.local/bin/vpnmenu') diff --git a/.local/bin/vpnmenu b/.local/bin/vpnmenu index d679c49..ff584e0 100755 --- a/.local/bin/vpnmenu +++ b/.local/bin/vpnmenu @@ -1,14 +1,10 @@ #!/bin/sh -current=$(expressvpn status | sed "s/.......................//; 1q") - -location=$(expressvpn list recomend | sed "1,4d; s/^.*\t//" | head | dmenu -l 10) - -if [ ! -n "$location" ] -then - notify-send -i "$HOME/.fonts/svg/shield.svg" -a "VPN Module" "Operation aborted" -else - expressvpn disconnect; expressvpn connect "$location" -fi - -# expressvpn disconnect; expressvpn connect "$location" +region="$(piactl get regions | dmenu -p "Select Region: ")" +update=$(kill -36 $(pidof dwmblocks)) + +[ "$region" == "" ] && notify-send -a " VPN" "Operation aborted" +[ "$region" != "" ] && piactl set region "$region" && \ + $update && notify-send -a " VPN" "Changed region to $region" && \ + sleep 3 && $update +# Comment next line if not using the vpn dwmblock -- cgit v1.2.3