Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Running .sh file with one button click

Writer Andrew Mclaughlin

I am a linux beginner and I am trying to automate a small task on my computer. In order to connect to my vpn, I have to open my terminal and type nordvpn connect
I have created a simple .sh script that does this for me.

#!/bin/bash
nordvpn connect

The problem is that to run this file I have to open my terminal and write `./vpn.sh
Is there a way I can automate this to be done with a single click?

2

2 Answers

Not sure about a click, but you could add a keyboard shortcut: Open Settings/Keyboard shortcuts, scroll to the bottom and press the plus sign. Give a name to your shortcut, enter /path/to/nordvpn connect as the command and then select a keyboard shortcut. Note: /path/to/nordvpn should be replaced by the output of which nordvpn.

2

To complement the very good alternative suggestion of Niclas Börlin to set up a shortcut key for this, I can add how the script can be set up to be run with a single mouse click, as originally asked.

You can create a .desktop launcher for the command. Such launcher will appear in your Application menu, from where you can pin it to the dock, providing one-click access.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy