.desktop Categories and functionality

So, I finally mashed together a working .desktop for Anaconda. Looks like this in essence (this is the generalisation except for Category, and AppsData is just a place I put everything that's not via the Software "store"):
[Desktop Entry]
Type=Application
Icon=/home/*username/AppsData/AppX/<app_icon.png>
Name=App Name
Exec=/home/*username/AppsData/AppX/
Terminal=false
Hidden=false
Keywords=search1,search2,search3
Categories=X-GNOME-Utilities
Comment=This app does something

This works fine. After trying to copy paste from others, trying out Arronax and then mashing it all together. Great learning experience :slight_smile:

But.... the categories and how they work is totally bonkers. It seems every application have different ways of writing them. For instance, "Utility" is marked red but plain words seem to be used in many .desktop files. The app Barrier for instance have only "Utility" and ends up in "Accessories". Complete chaos :slight_smile:
Can someone point me in the right direction on what the categories are in Zorin (if they are specific)?

Also, when I try to make one for Blender it looks like this (apart from that the svg doesn't work as an icon):
[Desktop Entry]
Type=Application
Icon=/home/*username/AppsData/Blender/blender.svg
Name=Blender
Exec=/home/*username/AppsData/Blender/blender
Terminal=false
Hidden=false
Keywords=modeling;3d;animation;blender;
Categories=Graphics;
Comment=3D modeling and animation studio

But I get all kinds of errors.

Why is this process not automated? Installing the LATEST software and have it show up in a category etc (i.e. properly "installed") can't be rocket science.

Forgot to mention: I'm aware I can get the latest Blender in the software store, but I really want to understand how .desktop works.

1 Like

The icon needs to have its size defined. In a normal icon set, this is done by the index.theme.
Stand-alone icons often have the size defined in the icon name.

On categories, you also have kind of 'sub-categories.' It is a bit like how a secretary may file "remodeling project" under "M" for Maintenance.
This may help:
https://specifications.freedesktop.org/menu-spec/latest/apa.html
Please be sure to follow the "additional categories" link and read the notes on the far right on those.

You seem to have a pretty good grasp of it. But it would help troubleshooting to know what errors you are getting specifically.
The entry above does not set a mimetype association...
You may try having:

Terminal=false
Type=Application
Categories=Graphics;3DGraphics;
MimeType=application/x-blender;

Ensure the exec file is marked from properties to run as a program. I suggest placing it in /etc or /opt and having e.g. (Using 2.92 version as an example below)

Exec=/opt/blender-2.92.0-linux64/blender

1 Like

Thank you! Now I feel I can give this another go :slight_smile:

Have you read the Gnome developer guide here on desktop files?

Found it after I posted :woozy_face:
Will read with much interest!