Add scripts to the Start menu of Linux Mint

by Daniel Pham
Published: Updated:
This entry is part 4 of 4 in the series Build SSH tunnel app with Zenity

In this article, I will guide you to add scripts to the Start menu of Linux Mint. You can do the same for Ubuntu or other operating systems (depending on the OS).

With the previous posts, you already have 2 scripts. A script used to create tunnels and a script used to delete tunnels.

Now we will add it to an item in the Start menu to easily call the program.

Choose where to place scripts and grant execution permission

There is one thing you need to do first, which is to choose where to put the scripts we wrote earlier.

For example, I will put it in the /home/danie/ssh-tunnel directory.

danie@linuxmint /home/danie/ssh-tunnel $ ls -al
total 16
drwxr-xr-x 2 danie danie 4096 Apr 23 15:44 .
drwxr-xr-x 6 danie danie 4096 Mar 29 13:42 ..
-rw-r--r-- 1 danie danie  984 Apr 23 15:44 kill-tunnel.sh
-rw-r--r-- 1 danie danie 1035 Mar 23 22:55 tunnel-info.sh

Next, we will grant execution permission for these scripts. This is necessary to be able to call it from the Start menu.

danie@linuxmint ~/Desktop/blog/writebash.com $ chmod 700 *.sh
danie@linuxmint ~/Desktop/blog/writebash.com $ ls -al
total 16
drwxr-xr-x 2 danie danie 4096 Apr 23 15:44 .
drwxr-xr-x 6 danie danie 4096 Mar 29 13:42 ..
-rwx------ 1 danie danie  984 Apr 23 15:44 kill-tunnel.sh
-rwx------ 1 danie danie 1035 Mar 23 22:55 tunnel-info.sh

Notice that the execution permission have changed from -rw- to -rwx.

Add scripts to the Start menu

I have written a detailed tutorial on how to add an item in the Start menu of Linux Mint. It is applicable for both Mint 17, 18 and 19. You can read the article below.

Recommended Reading: How to add a menu item in Linux Mint

You only need to set the item as images below.

Item for the menu create ssh tunnel.

item for the menu create ssh tunnel
Item for the menu create ssh tunnel.
  • Name: SSH Tunnel
  • Command: /home/danie/ssh-tunnel/tunnel-info.sh
  • Comment: Anything you want

And the item for the menu delete ssh tunnel.

item for the menu delete ssh tunnel
Item for the menu delete ssh tunnel.
  • Name: Kill SSH Tunnel
  • Command: /home/danie/ssh-tunnel/kill-tunnel.sh
  • Comment: Anything you want

Check the result

Now try opening the start menu and clicking on the ssh tunnel creation program. Click on any item in the list.

click to start ssh tunnel program
Click to start SSH Tunnel program.

Conclusion

Here, basically the your ssh tunnel program is complete. You already have a GUI program written in bash script. It is quite simple and easy to write code with Zenity.

Use your idea to create other GUI programs from the bash script as you wish. That is unlimited, this is just a simple practical example for your reference.

(This is an article from my old blog that has been inactive for a long time, I don’t want to throw it away so I will keep it and hope it helps someone).

0 0 votes
Article Rating
Series Navigation«« Previous part: Create script file to delete ssh tunnel

You may also like

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

DevOps Lite is a personal blog specializing in technology with main topics about DevOps, DevSecOps, SRE and System Administrator. Articles are shared for free and contributed to the community.

SUPPORT US

FOLLOW US

Subscribe my Newsletter for new blog posts. Stay updated from your inbox!

© 2021-2024 DevOpsLite.com – All rights reserved.

Please write sources “DevOpsLite.com” when using articles from this website.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

2
0
Would love your thoughts, please comment.x
()
x

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.