Create Desktop Icon

From HIO Wiki
Jump to: navigation, search


This tutorial will show how to create basic icons to execute applications for Yocto Embedded Linux operate with X Window. For more information about technical details, visit
The *.desktop file fills two primary functions. one is to informs the desk environment how to handle the applications. E.g. associate name and description of the application, display of icons, recognize the MIME types it supports for opening files. The second one is a direct shortcut to the desktop.
Most of the *.desktop files are located in /usr/share/applications and their respective icons are located in /usr/share/pixmaps

Key Elements

The table below cover some basic elements that are used inside the *.desktop file.

Required Elements
Type This defines the 3 valid type of desktop entries: Application,Link,or Directory
Name The specific name of the application
Exec Provide absolute path for program to execute, possibly with arguments.
Optional Elements
Icon Icon to display for the application; If specified in absolute path, the corresponding file will be used. Otherwise, the system will specify the icon.
Terminal Boolean value to specify whether application type programs should run in the terminal.
Comment Specify the tooltip entries, should not be redundant with the values of Name
Categories Specify which categories the entry should be shown in the desktop
StartupNotify Boolean value to enable the desktop to use whatever built-in startup notification.
MimeType Specify the MIME type supported by the application
SingleInstance Boolean value to specify whether the program can run in again when it is already running


To create a Desktop Icon:

  • In the embedded device, change directory to /usr/share/applications
  • Create a new file *.desktop, e.g. Cube.desktop
  • Input the required elements
  • Input the optional elements
  • Save the *.desktop file
  • The desktop icon should automatically appear in the desktop. Otherwise, restart the device.


Example of Qt5 Cube.desktop

[Desktop Entry]
Name=Qt3D Basket
Comment=Qt3D Cube Desktop Icon Example

Example of mozilla-firefox.desktop

[Desktop Entry]
Name=Firefox Browser
Comment=Firefox Web Browser

For more examples, visit any ubuntu desktop files located in /usr/share/applications