knowledge/technology/files/Desktop Entry.md
2024-03-06 13:15:41 +01:00

2.6 KiB

arch-wiki obj extension mime
https://wiki.archlinux.org/title/desktop_entries concept desktop application/desktop

Desktop Entry

The XDG Desktop Entry specification defines a standard for applications to integrate into application menus of desktop environments implementing the XDG Desktop Menu specification.

Basics

Each desktop entry must have a Type and a Name key and can optionally define its appearance in the application menu.

The three available types are:

Application

Defines how to launch an application and what MIME types it supports (used by XDG MIME Applications. With XDG Autostart Application entries can be started automatically by placing them in specific directories. Application entries use the .desktop file extension.

Defines a shortcut to a URL. Link entries use the .desktop file extension.

Directory

Defines the appearance of a submenu in the application menu. Directory entries use the .directory file extension.

Application entry

Desktop entries for applications, or .desktop files, are generally a combination of meta information resources and a shortcut of an application. These files usually reside in /usr/share/applications/ or /usr/local/share/applications/ for applications installed system-wide, or ~/.local/share/applications/ for user-specific applications. User entries take precedence over system entries.

File example

Following is an example of its structure with additional comments. The example is only meant to give a quick impression, and does not show how to utilize all possible entry keys. The complete list of keys can be found in the freedesktop specification.

[Desktop Entry]
# The type as listed above
Type=Application

# The version of the desktop entry specification to which this file complies
Version=1.0

# The name of the application
Name=jMemorize

# A comment which can/will be used as a tooltip
Comment=Flash card based learning tool

# The path to the folder in which the executable is run
Path=/opt/jmemorise

# The executable of the application, possibly with arguments.
Exec=jmemorize

# The name of the icon that will be used to display this entry
Icon=jmemorize

# Describes whether this application needs to be run in a terminal or not
Terminal=false

# Describes the categories in which this entry should be shown
Categories=Education;Languages;Java;