preface

Deepin’s app store is indeed very convenient, like android’s app marketplace, where apps can be installed with one click. A new icon will appear on the launcher interface after we install the software. Most software will automatically generate ICONS when installed, but sometimes you install software or write your own programs may not have ICONS, so today we will talk about how to customize your launcher icon, this content is suitable for all Linux systems using KDE and GNOME.

Desktop Entry

Let’s start with Desktop Entry. Desktop Entry functions like a Shortcut in Windows. This file is used to quickly launch applications in Linux. Both KDE and GNOME use this “desktop portal” approach to allow users to quickly launch applications. Most applications automatically create a.desktop file when they are installed to make it easier for users to start. But sometimes we install software or write their own programs may not have ICONS, this time we need to create a.desktop file to display ICONS. This file is the Desktop Entry file.

A Desktop Entry file looks something like this:

[Desktop Entry]
The type of the entry
Type=Application
# Display terminal (optional)
Terminal=false
Click on the entry to execute the command
Exec=/path/to/executable
# The program name
Name=Name of Application
# Icon path displayed in entrance (optional)
Icon=/path/to/icon
Copy the code

To save the file to the desktop suffix file, and then put in/usr/share/applicaitions/directory can see our custom icon in the launcher. If you don’t see the launcher appear, you may have the following problems:

  • Image not accessible
  • The configuration file is incorrect

If clicking on the icon does not respond, you may have a command execution problem.

If this section is ready for you, then you can choose not to continue reading.

The file name

Desktop Entry Files Except the. Directory suffix for files whose Type is Type Directory, the extension name of other files should be Desktop.

For applications, the name before.desktop should be a valid Dbus-well-known-name, which means that the name should be a valid dbus-well-known -name. A delimited sequence of non-empty strings, each part of which is not a string of length greater than one beginning with a number, whose characters should be in the set [A-za-Z0-9-_].

The name of the desktop entry should follow the reverse DNS convention, which should start with the reverse DNS domain name (lowercase) followed by the application name, which usually consists of a word and an uppercase letter (CamelCase). For example, if the owner of example.org to write “Foo Viewer”, they may choose to org. Example the name, generate a called org. Example. FooViewer. Desktop file.

Well-known names that contain dashes are allowed, but not recommended, as dashes are not allowed in some related uses of reverse DNS names. If the author’s domain name contains a dash, it is recommended to replace it with underscores: this does not create ambiguity, as underscores are not allowed in DNS domain names.

reference

  • Desktop-entry-spec
  • Arch-wiki
  • Deepin-wiki