summaryrefslogtreecommitdiff
path: root/.local/bin/vpnmenu
diff options
context:
space:
mode:
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