Ubuntu – How to create a native application from a Shell Script

bashscripts

I created a little application using Bash and Zenity that I wish to install on my system as a native application as well as a package that I can distribute. I have a .desktop file for my application, a .png icon, and the .sh file. Where do these files go to make a "native" application, and by what process would I need to go to create a package that can be compiled to install this application on another system?

Best Answer

About the first part: To start with, I would make the script executable and remove .sh extension from both the script and the .desktop file. If you want to use it system wide, then copy the whole directory, except the .desktop file, to /opt. The .desktop file would then be:

[Desktop Entry]
Version=1.0
Type=Application
Name=GTeaKup
Comment=The perfect GTK tea timer!
Exec=/bin/bash gteakup
Icon=gteacup.png
Path=/opt/GTeaKup/
Terminal=false
StartupNotify=false

...and copy that to /usr/share/applications

About the second half of your question: take a look here, especially this one is nice to start with if you never created Debian packages before. You will then get an installer like this. When you install it via the software center, it will complain, because the usual files like changelog, copyright etc. files are not included, but it works fine.

btw you do know that your script acts differently on double-click and when the ok button is chosen? ;)

Related Question