summaryrefslogtreecommitdiff
path: root/.local/bin/vpnmenu
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2020-10-26 00:38:53 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2020-10-26 00:38:53 -0400
commitbdbd07823796973d11536dc05dc1cf7bb11f2341 (patch)
treedc09fed7f0f5bc9e7e6d6035c6856d1bd6befdb2 /.local/bin/vpnmenu
parent7879ffd66844128ccb20dd6b763658e1016856fe (diff)
moving to pia as a vpn provider
Diffstat (limited to '.local/bin/vpnmenu')
-rwxr-xr-x.local/bin/vpnmenu20
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