Run a .sh file from the Applications menu (Zorin Pro 17)

I recently installed a third party application that was delivered as a folder containing a .sh file.
When the app starts it is within Terminal and it runs properly.
I would like to know how to have the app show up in the Applications menu so that I can just start it there without going to the .sh file every time.

I tried building a .desktop file in
~/.local/share/applications
But it still does not appear in the Applications menu.

Do I need sudo to register the file or ?

1 Like

Hi Fossware, welcome to the forum!

I ran into a similar issue before. Instead of giving a one-size-fits-all solution, let me ask a few questions:

  • Did you structure your .desktop file similarly to the example in this post? (The post is about a different solution, but there is the .desktop structure below.)
  • Is your .desktop file executable (chmod +x applied)?
  • Did you refresh the application menu by running:
update-desktop-database ~/.local/share/applications/

Let us know the checks! :blush:

Hmm ... You couly try to create in the Main Menu Program an Entry and in the Line for the Command the Execution of the .sh File.

Hi codesniper, thanks for the quick reply.
Here is the file:
[Desktop Entry]
Type=Application
Terminal=False
Exec="/home/fw/utilities/docfetcher/version-full/DocFetcherPro-1.20-Linux-64bit-Portable/DocFetcherPro.sh"
Name=DocFetcherPro
Icon="/home/fw/utilities/docfetcher/version-full/DocFetcherPro-1.20-Linux-64bit-Portable/img/docfetcher32.png"
Comment=Document Indexing and Search
Categories=Utilities;Other;

I checked properties on the .desktop file,
Allow executing as a file is on.
The update-desktop... did not help

Thanks for the reply, not sure what you mean by 'Main Menu Program'

I suspect two issues:

  • The script path is not correct. In such case the application updater may ignore the .desktop file.
  • The Category definition is wrongly interpreted.

What do you see when you search for the part of the name such as:

I tested different Categories settings and found:

:white_check_mark: Shows under "Utilities":

Categories=X-GNOME-Utilities;

:white_check_mark: Shows under "Others":

Categories=Other;

:x: Didn't show under "Utilities" when using these categories, even individually:

Categories=GTK;GNOME;Utility;

but I could search for the Application shortcut and run it. So it was there, but not categorized.

Category change worked immediately with:

update-desktop-database ~/.local/share/applications/

Icon update required logging out and back in.

1 Like

Hm, the observed behavior is somehow not compliant with the expectations according to Registered Categories | Desktop Menu Specification

1 Like

It is a Program for managing the Start Menu. It is directly called ''Main Menu''. I looks like this:

Depending on Your used Theme and Icons the Look can be different in Your Case. When You create a new Entry there, You get this Window:

You have to fill this and then You should get an Start Menu entry for this.

codesniper

I have tried a bunch of variations for Categories= but have not found any that works, even omitting the line altogether.

From the image you sent, it appears that you are have installed DocFetcher also.

I have found a solution though in my next reply.

I want to thank you for comments and assistance.

Ponce-De-Leon

Thank you for your help, I added the info to Main Menu and it showed up in the Zorin applications menu and started with a simple click on the name.

Very strange though, it does not appear in any of the Main Menu categories.

No, I don't. The DocFetcher link at the bottom leads to the Software app, where I can install DF.

Reconsider marking Ponce-De-Leon's post as Solution, please.

Nice tool. Unfortunately, there is no information about the category to the items. The items are created and shown in the Categories where they were created, but the created .desktop file (in ~/.local/share/applications/) contains no category designation either. Strange. Where is the individual .desktops' category information stored?

codesniper
The application shows up in 'Other'

codesniper
You are right, it sure would be nice to be able to specify category.
Apparently the Category= is just ignored if it is present.

That You can choose. When You open Main Menu like You see on my first Picture, You have on the left Side the Categories. Simply click on one and it is chosen. then You see in the middle Part the Entries in the chosen Category. And when You then create the Entry. it will be in the chosen Category.

Sorry, I had to explain that directly. My Mistake.

What I meant is that .desktop files are created, but the Category information is not stored within. This Category information is stored elsewhere. Where?

You wrote above:

This didn't worked because You wrote ''Utility'' and not ''Utilities''. And when You want a new Category, You can add it manually in Main Menu.

I wasn’t satisfied with the incomplete and inconsistent handling of application categories in Zorin OS, while testing the above, so I took matters into my own hands.

To fully understand how Zorin OS manages .desktop file categories, I wrote some scripts that systematically:

E.g. dummy-Development.desktop:

[Desktop Entry]
Version=1.0
Type=Application
Name=Dummy Development App
GenericName=Development Application
Comment=This is a dummy application for Development.
Exec=sh -c 'notify-send "Launching Development-Category application"'
Icon=application-x-executable
Categories=Development;
Terminal=false

Then I analyzed how Zorin OS categorizes these entries. The findings were illuminating:

  • Not all main Freedesktop categories appear in any of Zorin OS’s predefined categories.
  • For some Zorin categories there is no Freedesktop equivalent, such as Utilities and Science.
  • Many categories are defaulted to Other.

Example of the dummy-Utility.desktop ending up in Accessories:

To make the results clear, I’m compiling a table that details which categories are properly recognized and where the unrecognized ones end up.

Zorin Menu Category Freedesktop Main Category Freedesktop Additional Category Others
Accessories Utility
Education Education
Games Game ActionGame AdventureGame ArcadeGame BlocksGame BoardGame CardGame KidsGame LogicGame RolePlaying Simulation SportsGame StrategyGame
Graphics Graphics
Internet Network
Office Office
Other Everything else from the category.list
Programming Development
Science
Sound & Video AudioVideo
System Tools Settings System
Universal Access Accessibility
Utilities X-Gnome-Utilities
Windows Apps Wine

All I can say, the Zorin category engineer was quite a Gamer...