Files
makronix/docs/reference/desktop-entry.txt
T
lotherkandClaude Opus 5.5 c86243fd24 mcde: dtappscan, the installed applications by category
CDE's application manager shows a fixed list, installed or not.
dtappscan reads the desktop entries of the installed packages (Desktop
Entry Specification 1.5) and a table of the desktop's own programs, keeps
what is on the PATH, and writes CDE actions, icons (PNG to XPM) and one
folder per category in ~/.dt/Applications, at every login before the
session loads its actions.  The file manager has Applications among its
places, and the application manager opens the same folder.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 19:02:22 +00:00

373 lines
15 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Desktop Entry Specification, version 1.5 (freedesktop.org)
Source: https://specifications.freedesktop.org/desktop-entry/latest/ (file-naming.html, recognized-keys.html, exec-variables.html, localized-keys.html), fetched 2026-11-11 for programs/dtappscan of MCDE (ext/src/mcde).
What dtappscan follows: the directories and the first-id rule (file naming), Type/Name/Exec/TryExec/Icon/Categories/NoDisplay/Hidden/OnlyShowIn/NotShowIn/Terminal (recognized keys), field codes removed, %f %F %u %U make the action take files (exec variables), Name[lang_COUNTRY] before Name[lang] before Name (localized keys). Not done: desktop file ids from subdirectories of applications/, %i/%c/%k expanded (they are removed), modifiers (@) in locales.
==== file-naming ====
2.1 Desktop File ID #
Each desktop entry representing an application is identified by
its desktop file ID, which is based on its
filename.
To determine the ID of a desktop file, make its full path relative to
the $XDG_DATA_DIRS component in which the desktop file is installed, remove the "applications/"
prefix, and turn '/' into '-'.
For example /usr/share/applications/foo/bar.desktop has
the desktop file ID foo-bar.desktop.
If multiple files have the same desktop file ID, the first one in the
$XDG_DATA_DIRS precedence order is used.
For example, if $XDG_DATA_DIRS contains the default paths /usr/local/share:/usr/share, then
/usr/local/share/applications/org.foo.bar.desktop and
/usr/share/applications/org.foo.bar.desktop both have
the same desktop file ID org.foo.bar.desktop, but only the first
one will be used.
If both foo-bar.desktop and foo/bar.desktop exist,
it is undefined which is selected.
If the desktop file is not installed in an applications subdirectory of one
of the $XDG_DATA_DIRS components, it does not have an ID.
→Basic format of the file←Desktop Entry Specification©
2026
Freedesktop.org
==== recognized-keys ====
Type
This specification defines 3 types of desktop entries:
Application (type 1),
Link (type 2)
and Directory (type 3).
To allow the addition of new types in the future,
implementations should ignore desktop entries with an
unknown type.
stringYES 
Version
Version of the Desktop Entry Specification that the
desktop entry conforms with. Entries that conform with this
version of the specification should use 1.5.
Note that the version field is not required to be present.
stringNO1-3
Name
Specific name of the application, for example "Mozilla".
localestringYES1-3
GenericName
Generic name of the application, for example "Web Browser".
localestringNO1-3
NoDisplay
NoDisplay means "this application exists, but don't display it in the menus".
This can be useful to e.g. associate this application with MIME types, so that
it gets launched from a file manager (or other apps), without having a menu
entry for it (there are tons of good reasons for this, including e.g. the
netscape -remote, or kfmclient openURL kind of stuff).
booleanNO1-3
Comment
Tooltip for the entry, for example "View sites on the
Internet". The value should not be redundant with the values of
Name and GenericName.
localestringNO1-3
Icon
Icon to display in file manager, menus, etc. If the
name is an absolute path, the given file will be
used. If the name is not an absolute path, the algorithm described
in the Icon
Theme Specification (http://freedesktop.org/wiki/Standards/icon-theme-spec) will be used to locate the icon.
iconstringNO1-3
Hidden
Hidden should have been called Deleted.
It means the user deleted (at their level)
something that was present (at an upper level, e.g. in the system dirs). It's
strictly equivalent to the .desktop file not existing at all, as far as that user is
concerned. This can also be used to "uninstall" existing files (e.g. due to a renaming)
- by letting make install install a file with Hidden=true in it.
booleanNO1-3
OnlyShowIn, NotShowIn
A list of strings identifying the desktop environments that
should display/not display a given desktop entry.
By default, a desktop file should be shown, unless an OnlyShowIn
key is present, in which case, the default is for the file not to
be shown.
If $XDG_CURRENT_DESKTOP is set then it contains a
colon-separated list of strings. In order, each string is
considered. If a matching entry is found in
OnlyShowIn then the desktop file is shown.
If an entry is found in NotShowIn then the
desktop file is not shown. If none of the strings match then
the default action is taken (as above).
$XDG_CURRENT_DESKTOP should have been set by the login manager, according to the
value of the DesktopNames found in the session file. The entry in the
session file has multiple values separated in the usual way: with a semicolon.
The same desktop name may not appear in both
OnlyShowIn and NotShowIn of
a group.
string(s)NO1-3
DBusActivatable
A boolean value specifying if D-Bus activation is supported for this application. If this key is
missing, the default value is false. If the value is true
then implementations should ignore the Exec key and send a D-Bus message to
launch the application. See D-Bus Activation for more information on
how this works. Applications should still include Exec= lines in their desktop files for
compatibility with implementations that do not understand the DBusActivatable key.
booleanNO 
TryExec
Path to an executable file on disk used to determine if the program
is actually installed. If the path is not an absolute path, the file
is looked up in the $PATH environment variable. If the file is not
present or if it is not executable, the entry may be ignored (not be
used in menus, for example).
stringNO1
Exec
Program to execute, possibly with arguments. See the
Exec key for details on how this key
works. The Exec key is required if DBusActivatable is not
set to true. Even if DBusActivatable is
true, Exec should be specified for compatibility with
implementations that do not understand DBusActivatable.
stringNO1
Path
If entry is of type Application, the working directory to run the program in.
stringNO1
Terminal
Whether the program runs in a terminal window.
booleanNO1
Actions
Identifiers for application actions. This can be used to tell the
application to make a specific action, different from the default
behavior. The Application actions
section describes how actions work.
string(s)NO1
MimeType
The MIME type(s) supported by this application.
string(s)NO1
Categories
Categories in which the entry should be shown in a menu (for
possible values see the Desktop
Menu Specification (http://www.freedesktop.org/Standards/menu-spec)).
string(s)NO1
Implements
A list of interfaces that this application implements. By default, a desktop file implements no
interfaces. See Interfaces for more information on how this
works.
string(s)NO 
Keywords
A list of strings which may be used in addition to other
metadata to describe this entry. This can be useful e.g. to
facilitate searching through entries. The values are not meant
for display, and should not be redundant with the values of
Name or GenericName.
localestring(s)NO1
StartupNotify
If true, it is KNOWN that the application will send a "remove"
message when started with the DESKTOP_STARTUP_ID environment variable set.
If false, it is KNOWN that the application does not work
with startup notification at all (does not show any window, breaks
even when using StartupWMClass, etc.).
If absent, a reasonable handling is up to implementations (assuming false,
using StartupWMClass, etc.). (See the Startup Notification Protocol Specification (http://www.freedesktop.org/Standards/startup-notification-spec) for more details).
booleanNO1
StartupWMClass
If specified, it is known that the application will map at least one
window with the given string as its WM class or WM name hint (see the Startup Notification Protocol Specification (http://www.freedesktop.org/Standards/startup-notification-spec) for more details).
stringNO1
URL
If entry is Link type, the URL to access.
stringYES2
PrefersNonDefaultGPU
If true, the application prefers to be run on a more powerful discrete GPU if available,
which we describe as “a GPU other than the default one” in this spec to avoid the need
to define what a discrete GPU is and in which cases it might be considered more powerful
than the default GPU.
This key is only a hint and support might not be present depending on the implementation.
booleanNO1
SingleMainWindow
If true, the application has a single main window, and does not support having an
additional one opened. This key is used to signal to the implementation to avoid
offering a UI to launch another window of the app.
This key is only a hint and support might not be present depending on the implementation.
booleanNO1
→The Exec key←Localized values for keys©
2026
==== exec-variables ====
Jump to contentJump to page navigation: previous page [access key p]/next page [access key n]The Exec keyContentsContentsDesktop Entry Specification
1 Introduction
2 File naming
3 Basic format of the file
4 Possible value types
5 Localized values for keys
6 Recognized desktop entry keys
7 The Exec key
8 D-Bus Activation
9 Interfaces
10 Registering MIME Types
11 Additional applications actions
12 Extending the format
A Example Desktop Entry File
B Historically Reserved Items
C Deprecated Items
D The Legacy-Mixed Encoding (Deprecated)
E Changes to this Specification
Navigation←→Show Contents: The Exec keyTop←→1 Introduction
2 File naming
3 Basic format of the file
4 Possible value types
5 Localized values for keys
6 Recognized desktop entry keys
7 The Exec key
8 D-Bus Activation
9 Interfaces
10 Registering MIME Types
11 Additional applications actions
12 Extending the format
A Example Desktop Entry File
B Historically Reserved Items
C Deprecated Items
D The Legacy-Mixed Encoding (Deprecated)
E Changes to this Specification
7 The Exec key #
The Exec key must contain a command line.
A command line consists of an executable program optionally followed
by one or more arguments.
The executable program can either be specified with its full path or
with the name of the executable only. If no full path is provided the
executable is looked up in the $PATH environment variable used by the
desktop environment.
The name or path of the executable program may not contain the equal
sign ("="). Arguments are separated by a space.
Arguments may be quoted in whole. If an argument contains a reserved
character the argument must be quoted. The rules for quoting of
arguments is also applicable to the executable name or path of the
executable program as provided.
Quoting must be done by enclosing the argument between double quotes
and escaping the double quote character, backtick character ("`"),
dollar sign ("$") and backslash character ("\") by preceding it with an
additional backslash character. Implementations must undo quoting before
expanding field codes and before passing the argument to the executable
program. Reserved characters are space (" "), tab, newline, double
quote, single quote ("'"), backslash character ("\"),
greater-than sign (">"), less-than sign ("<"),
tilde ("~"), vertical bar ("|"), ampersand ("&"), semicolon (";"),
dollar sign ("$"), asterisk ("*"), question mark ("?"), hash mark ("#"),
parenthesis ("(") and (")") and backtick character ("`").
Note that the general escape rule for values of type string states that
the backslash character can be escaped as ("\\") as well and that this
escape rule is applied before the quoting rule. As such, to
unambiguously represent a literal backslash character in a quoted
argument in a desktop entry file requires the use of four successive
backslash characters ("\\\\"). Likewise, a literal dollar sign in a
quoted argument in a desktop entry file is unambiguously represented
with ("\\$").
A number of special field codes have been defined which will be
expanded by the file manager or program launcher when encountered
in the command line.
Field codes consist of the percentage character ("%") followed by
an alpha character. Literal percentage characters must be escaped
as %%.
Deprecated field codes should be removed from the command line and
ignored.
Field codes are expanded only once, the string that is used to
replace the field code should not be checked for field codes itself.
Command lines that contain a field code that is not listed in this
specification are invalid and must not be processed, in particular
implementations may not introduce support for field codes not listed
in this specification. Extensions, if any, should be introduced by
means of a new key.
Implementations must take care not to expand field codes into multiple
arguments unless explicitly instructed by this specification.
This means that name fields, filenames and other replacements that
can contain spaces must be passed as a single argument
to the executable program after expansion.
Although the Exec key is defined to have a value
of the type string, which is limited to ASCII characters, field code
expansion may introduce non-ASCII characters in arguments.
Implementations must take care that all characters in arguments
passed to the executable program are properly encoded according to
the applicable locale setting.
Recognized field codes are as follows:
CodeDescription
%f
A single file name (including the path), even if multiple files are selected. The system
reading the desktop entry should recognize that the program in
question cannot handle multiple file arguments, and it should
probably spawn and execute multiple copies of a program
for each selected file if the program is not able to handle
additional file arguments. If files are not on the local file system
(i.e. are on HTTP or FTP locations), the files will be copied to the local
file system and %f will be expanded to point at the temporary
file. Used for programs that do not understand the URL syntax.
%F
A list of files. Use for apps that can open several local
files at once.
==== localized-keys ====
selected by matching the current POSIX locale for the
LC_MESSAGES category against the
LOCALE postfixes of all occurrences
of the key, with the
.ENCODING part
stripped.
The matching is done as follows. If
LC_MESSAGES is of the form
lang_COUNTRY.ENCODING@MODIFIER,
then it will match a key of the form
lang_COUNTRY@MODIFIER.
If such a key does not exist, it will attempt to match
lang_COUNTRY
followed by
lang@MODIFIER.
Then, a match against lang by itself
will be attempted. Finally, if no matching key is found the
required key without a locale specified is used. The encoding
from the LC_MESSAGES value is ignored
when matching.
If LC_MESSAGES does not have a MODIFIER
field, then no key with a modifier will be matched. Similarly, if
LC_MESSAGES does not have a COUNTRY
field, then no key with a country specified will be matched. If
LC_MESSAGES just has a lang field, then
it will do a straight match to a key with a similar value. The
following table lists possible matches of various LC_MESSAGES values in
the order in which they are matched. Note that the
ENCODING field isn't shown.
Table 1: Locale Matching #
LC_MESSAGES valuePossible keys in order of matching
lang_COUNTRY@MODIFIER
lang_COUNTRY@MODIFIER,
lang_COUNTRY,
lang@MODIFIER,
lang,
default value
lang_COUNTRY
lang_COUNTRY,
lang,
default value
lang@MODIFIER
lang@MODIFIER,
lang,
default value