How To Execute/Run Your Bash Script As A Desktop Application


In this post we will see how to add an icon to our shell script to make it more visible & improve looks. Follow the below steps in order to do that.

1)First you have to give permission to you main bash script (.sh file).

chmod +x /home/user/Downloads/path to yourscript.sh

2)Then create a new file on desktop in gedit  and type below lines in the script.

[Desktop Entry]
Name=My script
Comment=Test hello world script
Exec=/home/user/yourscript.sh
Icon=/home/user/youricon.gif
Terminal=false
Type=Application


Where Exec is the path of .sh file and Icon is the path of any picture for that file.


3)Save as it any name.desktop(e.g run.desktop)

4)Give permission to this file with below command.

chmod +x Desktop/run.desktop


Enjoy!

Sharing is Caring😀

Post a Comment

0 Comments