Redone the vpntoggle script

This commit is contained in:
Thomas Dehaeze 2019-05-30 16:24:34 +02:00
parent a3f5e32c6e
commit 6b5a0b26b2

View File

@ -111,7 +111,8 @@ Script taken from Luke Smith.
if [[ $(nordvpn status) == *"Connected"* ]]; then
nordvpn disconnect && dunstify --replace=23198 "VPN" "Disconnected";
else
country=`nordvpn countries | sed 's/\s*\t\s*/ /g ; s/\s/\n/g ; s/_/ /g ; /^[a-zA-Z]/!d ; s/\(.*\)/\L\1/' | rofi -i -dmenu | sed 's/\s/_/g'`
country=`cat ~/bin/nordvpn_countries.txt | sed 's/\s*\t\s*/ /g ; s/\s/\n/g ; s/_/ /g ; /^[a-zA-Z]/!d ; s/\(.*\)/\L\1/' | rofi -i -dmenu | sed 's/\s/_/g'`;
dunstify --replace=23198 "VPN" "Connecting to $country...";
nordvpn connect $country && dunstify --replace=23198 "VPN" "Connected to $country";
fi
#+end_src