Building a Xojo.desktop or other App.desktop file

Hi Follks,

If you’re looking at creating a desktop file for Xojo so that it shows up in your menus, a couple of important tips:

When you add the Exec= line with the path to Xojo (for example:

Exec=/opt/xojo/Xojo 2017r2.1/Xojo

You don’t need to quote the path or escape the space. However, for the Icon= line, you DO need to quote or escape:

Icon=/opt/xojo/Xojo\\ 2017r2.1/xojo.xpm

I had forgotten about this and it was reported by our team back in 2008 or 2009, but the desktop team haven’t made any changes.

Here’s a full .desktop example - /usr/share/applications/xojo2017r21.desktop:

[Desktop Entry]
Encoding=UTF-8
Name=Xojo 2017r3
Name[en_GB]=Xojo 2017r3
Comment=Xojo 2017 Release 3
Comment[en_GB]=Xojo 2017 Release 3
Exec=/opt/xojo/Xojo 2017r2.1/Xojo %F
Icon=/opt/xojo/Xojo\\ 2017r2.1/xojo.xpm
Terminal=false
Type=Application
MimeType=application/xojo.project.binary;application/xojo.project.normal;application/xojo.project.xml
Categories=Development;Programming;Building;IDE

Hmm. If I quote the Icon Path on Ubuntu 14, I don’t see the Icon. The Icon only shows when NOT quoting the Path.
You’re using a different distribution, right? Which one? And you need it quoted to show (the Icon doesn’t show for you when not quoted)?

And I wonder… how would one write a .desktop file out of an own application, so that the user can save a .desktop shortcut?
As it seems to depend on the Distribution - how to figure out if the Path needs to be quoted or not (so that the Icon is being shown)?