I did this as an experiment because various people have tried Nord and complained that it doesn;t have GUI Linux App (it is Terminal Only).
It works for me, and I'd be interested to hear if anyone with Nord finds it easy or useful.
Nord has a whole page of commands to connect to and query stuff. I've only connected buttons to the most often used commands. It is dead easy to add whatever other bash commands you would use most often.
U P D A T E:
RiptideC Has made some changes to my little GUI that make it work better with 'normal' Mint desktops. You might notice in my original scripts my Terminal is konsole. Changing that is only one of several differences.
There is a better description in this viewtopic.php?p=2129961#p2129961 reply and also a link to the code which is now posted on GitHub
***
My original post starts below:
I recently had a reason to try out Nord VPN and found that it works better than PIA (at January 2022) for some streaming sites like Amazon Prime Video. I posted the Zenity code for a simple GUI, but it is lost in another post about VPN recommendations, so I thought I might post it here for anyone who is trying Nord VPN and is frustrated by the Terminal Only app for Linux.
I know there are some really nice looking Python GUIs out there on GitHub, and I have tried a couple of them. All they did (well, the only one that 'seemed' to start) was screw up my configuration.
So, while this script is 'quick and dirty', it has everything set up one step at a time, starting Left to Right, and the main options in order to open and close.
It uses 'Zenity' which should be already installed (sudo apt install zenity).
Pressing LogIn will open a Terminal and after a moment a Hylerlink should appear.
Right click on the link and choose Open
Your default Browser should open at a Login screen for NordVPN and ask for your credentials.
Once it has verified you, it will tell you and a link will show below the login details saying 'Return to the App'. Click the link and it might take you back to the terminal.
That's the most complicated part of the whole provedure.
At present there's NO List of Servers or Countries. Pressing 'Connect' on the GUI should automatically connect you to the nearest / closest NordVPN server in your country.
The Status button is just to see if you are logged in or connected. The Check button is to see what options you have active at the moment. It and the Status button can be pressed at any time to see what is running)
I set Check after the DNS button because I wanted to see if DNS was set before I actually connect.
Clicking the DNS button lets you enable a DNS (I am using Cloudflare - but you can set it easily to Google or whatever the 4 x 9 one is).
Whenever you choose a button, a Terminal window should open and display the result of that action.
Whenever you close a Terminal window the GUI should come up again.
Pressing the QUIT button closes the GUI, but does NOT (or at least it should not) kill your VPN connection. To do that you should choose DISconnect, followed by Log Out - then Quit to close the App.
That's why it is 'Quick and Dirty'. It is easy enough to add some more options - I just haven't needed them.
The first bit of code is a .desktop file. Save it in /home/Desktop, and give it an Icon you can see easily. Put in in your Panel and click on it to open the GUI.
Here's what it looks like today (Jan 21 2022):
The Zenity GUI as it opens:
After the Check button is pressed - showing the options I have selected. If I had pressed the Kill Switch Button, it would show as ON. (Closing this Terminal returns to the GUI):
Because it has changed a bit since I posted it in the other thread - Later today or maybe tomorrow I will add the code (again) below for:
NordVPN.desktop
Code: Select all
[Desktop Entry]
Comment[en_AU]=
Comment=
Exec="bash /home/ross/Desktop/Shell-Scripts/NordVPN/nordvpn.sh" %U
GenericName[en_AU]=
GenericName=
Icon=/home/ross/Custom_Icons/vpn-png.png
MimeType=
Name[en_AU]=NordVPN-ZENITY
Name=NordVPN-ZENITY
Path=
StartupNotify=true
Terminal=true
TerminalOptions=\s--noclose
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=
nordvpn.sh
Copied
Code: Select all
#!/bin/bash
#
# nordvpn.sh - BASIC NordVPN GUI (Zenity)
#
# to use the GUI; Open a Terminal in the Folder that holds nordvpn.sh
# run: bash nordvpn.sh
#
#LEAVE the Terminal Window or windows OPEN (ALL of them !!!) until you log out
# with any luck it should just be your ORIGINAL Terminal opened in the folder with the file
#
# Work in this order: Status (Check) - LogIn - Connect - KillSwith ON - KillSwitch OFF -DISconnect - LogOut
# Added Kill Switch Buttons because sometimes the computer had to be rebooted to reset it.
# (this NordVPN Zenity is modified from something I saw running a PiBot)
rc=1 # OK button return code =0 , all others =1
while [ $rc -eq 1 ]; do
ans=$(zenity --info --title 'NordVPN' \
--ok-label Quit \
--extra-button Status \
--extra-button LOGIN \
--extra-button DNS \
--extra-button CHECK \
--extra-button Connect \
--extra-button Kill-Sw-ON \
--extra-button Kill-Sw-OFF \
--extra-button DISconnect \
--extra-button LogOUT \
--extra-button Spare \
)
rc=$?
echo "${rc}-${ans}"
echo $ans
if [[ $ans = "Status" ]]
then
konsole --noclose -e /usr/bin/nordvpn status;
elif [[ $ans = "LOGIN" ]]
then
konsole --noclose -e /usr/bin/nordvpn login %U;
elif [[ $ans = "DNS" ]]
then
konsole --noclose -e /usr/bin/nordvpn set dns 1.1.1.1 1.0.0.1;
elif [[ $ans = "Connect" ]]
then
konsole --noclose -e /usr/bin/nordvpn connect;
elif [[ $ans = "CHECK" ]]
then
konsole --noclose -e /usr/bin/nordvpn settings %U;
elif [[ $ans = "Kill-Sw-ON" ]]
then
konsole --noclose -e /usr/bin/nordvpn set killswitch on;
elif [[ $ans = "Kill-Sw-OFF" ]]
then
konsole --noclose -e /usr/bin/nordvpn set killswitch off;
elif [[ $ans = "DISconnect" ]]
then
konsole --noclose -e /usr/bin/nordvpn disconnect;
elif [[ $ans = "LogOUT" ]]
then
konsole --noclose -e /usr/bin/nordvpn logout;
fi
done
I keep these scripts in:
/home/ross/Desktop/Shell-Scripts/NordVPN/
But as long as the paths work, you could keep them just about anywhere.
I find it is just easier to keep the .desktop file in the same directory as nordvpn.sh (makes it easier to run if both files are in the same place).
It would probably make sense to put the Icon in there too.
I have a /home/Custom-Icons folder, but I do a LOT of scripts that use a .desktop file to start them - so for me I have all my icons together.
Just make sure the path in the NordVPN.desktop file points to where the icon IS.
There are some nice icons to download in DuckDuckGo images or Giggle Images.