diff options
author | Benjamin Chausse <benjamin@chausse.xyz> | 2020-10-26 00:38:53 -0400 |
---|---|---|
committer | Benjamin Chausse <benjamin@chausse.xyz> | 2020-10-26 00:38:53 -0400 |
commit | bdbd07823796973d11536dc05dc1cf7bb11f2341 (patch) | |
tree | dc09fed7f0f5bc9e7e6d6035c6856d1bd6befdb2 /.local/bin/vpnmenu | |
parent | 7879ffd66844128ccb20dd6b763658e1016856fe (diff) |
moving to pia as a vpn provider
Diffstat (limited to '.local/bin/vpnmenu')
-rwxr-xr-x | .local/bin/vpnmenu | 20 |
1 files changed, 8 insertions, 12 deletions
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 |