Adding .sh files as regular programs in Linux

July 27th, 2017

There are programs that only comes with an .sh file to open it. While you can easily open it with that file, it’s really handy to add it to the menu.

The first thing you do, is to run this command from the terminal:

ls /usr/share/applications

If that’s not found, try:


This will list all your current desktop icons, which are what you find in the “start” menu. You can write it yourself easy enough, but just modifying an existing one can be practical. Copying the .desktop file from a program that’s similar to the one you want to add is the easiest. Once you’ve found a victim, run this command:

sudo cp victim.desktop newname.desktop

If you want to make a new, empty file, this is the command:

sudo nano newname.desktop

This will make a new file, with the original files content, but your new program as filename. Next, you’ll need to make some changes for this not to be useless. Open the new file in an editor, nano here:

sudo nano /usr/share/applications/newname.desktop

You only need full path if you haven’t cd’d to the directory. This is done with:

cd /usr/share/applications

Now, let’s edit it. There might me entries that you don’t understand what does. Many can be removed without any issues. I used KeePass2, which didn’t have too many things I didn’t want.

The (parentheses) are information from me and should not be typed into the .desktop file!

[Desktop Entry]  (this is the part you want to keep/edit)
Name=NameOfProgram  (name of the program you want to add)
Comment=AComment  (if you add to panel and hover, it’s displayed)
Exec=/path/  (complete path to .sh file)
Icon=/path/  (complete path to icon file, if any)
Terminal=false  (if true terminal will run .sh)
Type=Application  (or link/directory)
StartupNotify=false  (disables startup notifications)
Categories=Utility  (where to put it in the menu “Office”, “System”, etc)


Now it should be available like any other program. Yay.


For more information about both the properties here, and their values, see: