Structure of basic .desktop file
[Desktop Entry]
Name=PrusaSlicer
GenericName=3D Printing Software
Icon="/path/to/icon"
Exec="/path/to/executable" %F
Terminal=false
Type=Application
MimeType=model/stl;application/vnd.ms-3mfdocument;application/prs.wavefront-obj;application/x-amf;
Categories=Graphics;3DGraphics;Engineering;
Keywords=3D;Printing;Slicer;slice;3D;printer;convert;gcode;stl;obj;amf;SLA
StartupNotify=false
StartupWMClass=prusa-slicer
Where are .desktop files located on Ubuntu (22.04)?
/usr/share/applications
~/.local/share/applications
The issue
When I create a new .desktop file, sometimes Ubuntu’s search doesn’t refresh its list and the newly added application doesn’t show up.
The fix
xdg-desktop-menu forceupdate
This istantly updates Ubuntu’s search results.
Useful commands
This command should be silent if everything goes well:
desktop-file-validate /path/to/file.desktop