List of valid Exec parameter variables

List of valid `Exec` parameter variables
Prev |  | Next

## List of valid `Exec` parameter variables

Each `Exec` field may take a number of arguments which will be expanded by the file manager or program launcher and passed to the program if necessary.

Literal `%` characters must be escaped as `%%`, and adding new format characters is not allowed. It's a fatal error to have an `Exec` field with a format character not given in the spec (exception to this are the deprecated format characters which can be ignored, that is expanded to no parameters, by the implementation). Again for emphasis: nonstandard extensions are not allowed here - you must add an `X-Foo-Exec` field if you have nonstandard `Exec` lines.

The escaping of the exec parameters is done in the way the mailcap specification describes. Take a look at RFC 1524 for more information.

Recognized fields are as follows:

`%f` | A single file name, 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 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.
`%u` | A single URL.
`%U` | A list of URLs.
`%d` | Directory containing the file that would be passed in a `%f` field.
`%D` | List of directories containing the files that would be passed in to a `%F` field.
`%n` | A single filename (without path).
`%N` | A list of filenames (without paths).
`%i` | The `Icon` field of the desktop entry expanded as two parameters, first `--icon` and then the contents of the `Icon` field. Should not expand as any parameters if the `Icon` field is empty or missing.
`%c` | The translated `Name` field associated with the desktop entry.
`%k` | The location of the desktop file as either a URI (if for example gotten from the vfolder system) or a local filename or empty if no location is known.
`%v` | The name of the `Device` entry in the desktop file.

Prev |  | Next
Recognized desktop entry keys | Home | Registering MIME Types