Create metadata files

The .desktop file is a simple text file in a standard key-value format with grouping. There are certain keys that are required as well as many optional ones (which we will not cover here). A basic desktop entry file may look like this:

[Desktop Entry]
Type=Application
Name=My Application
Exec=myapp %f
Icon=myapp.png
Categories=Utility

Save the content to a suitably named file, such as myapp.desktop, next to your compiled binary file. This file sets out the basic application information—the type of executable it describes (Application) and the name that will be used for display (you can add additional information with Comment if required). The name can be localized (displayed in different languages) as well—for this, use the Name[fr]=French Name format. We then specify the executable (this can be just the filename, in which case the location will be looked up, or an absolute path to the installed binary). The %f parameter indicates that the executable can accept a single file parameter and is useful for things such as dragging and dropping files onto your application icon (omit this if you do not support command arguments). We need to specify the icon parameter to tell the system the how to find the icon for this application (in this case, it will look for myapp.png in the theme icon paths). Optionally, we can specify categories that this application should appear within— excluding this element may mean the icon does not appear in system menus. A full list of supported categories is available online at specifications.freedesktop.org/menu-spec/latest/apa.html#main-category-registry.

To make it easier for users to find your software once it's installed, be sure to choose a clear name and set the right category for your application. You can use the Comment property to provide more information, but that may not always be shown.
On some systems, the category is more than a menu grouping. For example, items in the Settings category may be placed into a control panel rather than the main application list.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.79.65