Files changed (2)
+This DRAFT document defines a method for automatically starting applications during the startup of a desktop environment and after mounting a removable medium.
+Some of the file locations in this specification are specified based on the ["desktop base directory specification"](http://standards.freedesktop.org/basedir-spec/).
+The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
+By placing an application's .desktop file in one of the Autostart directories, the application will be automatically launched during startup of the user's desktop environment after the user has logged in.
+The Autostart Directories are `$XDG_CONFIG_DIRS/autostart` as defined in accordance with the ["Referencing this specification"](http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#referencing) section in the ["desktop base directory specification"](http://standards.freedesktop.org/basedir-spec/).
+If the same filename is located under multiple Autostart Directories only the file under the most important directory should be used.
+Example: If `$XDG_CONFIG_HOME` is not set the Autostart Directory in the user's home directory is `~/.config/autostart/`
+Example: If `$XDG_CONFIG_DIRS` is not set the system wide Autostart Directory is `/etc/xdg/autostart/`
+Example: If `$XDG_CONFIG_HOME` and `$XDG_CONFIG_DIRS` are not set and the two files `/etc/xdg/autostart/foo.desktop` and `~/.config/autostart/foo.desktop` exist, then only the file `~/.config/autostart/foo.desktop` will be used because `~/.config/autostart/` is more important than `/etc/xdg/autostart/`.
+An application .desktop file must have the format as defined in the ["Desktop Entry Specification"](http://standards.freedesktop.org/desktop-entry-spec/). All keys except for the keys described in this document (the one you are now reading) should be interpreted as defined in the Desktop Entry Specification. Furthermore, it should be understood that, in contrast to the ordinary usage of .desktop files to make application names and/or icons to appear in a menu or in a file-manager window, a .desktop file that exists within one of the Autostart directories is used primarily to determine whether an application will automatically start or not, and has no influence over the application's appearance or the lack thereof in menus or file-manager windows.
+For any version of the autostart specification newer than version 0.5, the `AutostartSpecVersion` SHOULD be specified. If the .desktop file contains no keys specific to autostart specifications newer than version 0.5, the `AutostartSpecVersion` MAY be specified.
+If an `AutostartSpecVersion` key exists, then the corresponding specification version should be followed.
+A .desktop file with a non-empty `TryExec` field MUST NOT be autostarted if the value of the `TryExec` key does NOT match with an installed executable program. The value of the `TryExec` field may either be an absolute path or the name of an executable without any path components. If the name of an executable is specified without any path components, then the `$PATH` environment is searched to find a matching executable program.
+When starting a specific desktop environment (DE) (e.g. Gnome, KDE, LXDE, XFCE), the DE may be configured to run under a specific *session* which influences various characteristics of the DE (e.g. default behavior, appearance, started applications, etc.). For a single user, a DE MAY allow the creation of multiple sessions which differ from each other, each having a unique session-name. If a DE is started without a specific session-name, the session-name of "<DE\_NAME>-default" is to be used (e.g. "Gnome-default"). Several of the following keys take a *session-name-list* as their value, which is a semicolon-separated list of DE session-names.
+In the case that there is no matching session-name in the `AutostartEnabledFor` or `AutostartDisabledFor` lists, then the `AutostartDefaultPolicy` key specifies a default policy regarding whether an application should be automatically started or not, and can take on either the value `true` (i.e. the application should be started by default) or `false` (i.e. the application should not be started by default). It is up to the DE to determine whether or not it will respect this default policy. Typically this policy will be specified in the system-wide .desktop file by a software package's maintainer, but it can of course be overridden by a .desktop file in a user's local autostart directory (e.g. `~/.config/autostart`).
+The `AutostartEnabledFor` key specifies a session-name-list for which the .desktop file is to be considered *enabled* (i.e. the application specified in the .desktop file MUST be loaded by the DE when it is running under a session having one of the session-names specified in this list).
+The `AutostartDisabledFor` key specifies a session-name-list for which the .desktop file is to be considered *disabled* (i.e. the application specified in the .desktop file MUST NOT be loaded by the DE when it is running under a session having one of the session-names specified in this list). In the case where a specific session-name is specified in both the `AutostartDisabledFor` and `AutostartEnabledFor` lists, then the application MUST NOT be loaded by the DE for when running under the session having this name.
+In the case that there is no matching session-name in the `HiddenFor` list, then the `HiddenDefaultPolicy` key specifies a default policy regarding whether or not an application should be hidden within a session-editing program, and can take on either the value `true` (by default, hide the application) or `false` (by default, show the application). Typically this policy will be specified in the system-wide .desktop file by a software package's maintainer, but it can of course be overridden by a .desktop file in a user's local autostart directory (e.g. `~/.config/autostart`). It is up to the author of a given session-editor program to determine whether or not the program will respect this default policy.
+The `HiddenFor` key specifies a session-name-list for which the .desktop file is to be considered *hidden*. The value of this key influences the behavior of session-editor programs (i.e. programs that allows the user to select which applications should and should not be started for a given session). If the session-name of a user's currently running session is found in the `HiddenFor` session-name-list, the application specified in the .desktop file SHOULD NOT be visible to the user when choosing which applications will or will-not autostart, except when made visible (or grayed out) by a non-default "advanced" mode offered by the session-editor program.
+Whether an application is hidden or not has no influence over whether it will or will not be autostarted. Autostarting is affected by the `AutoStart*` keys.
+The following keys should not be used in .desktop files unless necessary for backward compatibility with DEs which don't recognize the `HiddenFor` and `HiddenDefaultPolicy` keys (introduced in version 0.6 of the Autostart specification). If an application is able to recognize any non-deprecated keys of this specification, and there is a conflict between any of the following keys and explicitly set non-deprecated keys, the non-deprecated keys are to take priority / effect over the deprecated ones.
+When the .desktop file has the `Hidden` key set to `true`, the .desktop file MUST be ignored. When multiple .desktop files with the same name exist in multiple directories, then only the `Hidden` key in the most important .desktop file must be considered: if it is set to `true`, all .desktop files with the same name in the other directories MUST be ignored as well.
+The `OnlyShowIn` entry may contain a list of strings identifying the desktop environments that MUST autostart this application, all other desktop environments MUST NOT autostart this application.
+The `NotShowIn` entry may contain a list of strings identifying the desktop environments that MUST NOT autostart this application, all other desktop environments MUST autostart this application.
+If an application autostarts by having a .desktop file installed in the system wide autostart directory, an individual user can disable the autotomatic start of this application by placing a .desktop file of the same name in the personal autostart directory which contains the key `AutostartDefaultPolicy=false`.
+When a desktop environment mounts a new medium, the medium may contain an *Autostart* which specifies a suggested application to start, or an *Autoopen* file which specifies a suggested application-file to load with the default application associated with this type of file.
+When a new medium is mounted the root directory of the medium should be checked for the following Autostart files in order of precendence: `.autorun`, `autorun`, `autorun.sh`. Only the first file that is present should be considered.
+The desktop environment MAY ignore Autostart files altogether based on policy set by the user, system administrator or vendor.
+The desktop environment MUST prompt the user for confirmation before automatically starting an application.
+When an Autostart file has been detected and the user has confirmed its execution, the autostart file MUST be executed with the current working directory (CWD) set to the root directory of the medium.
+When a new medium is mounted and a) the medium does not contain an Autostart file, or b) a policy to ignore Autostart files is in effect, then the root directory of the medium should be checked for the following Autoopen files in order of precedence: `.autoopen`, `autoopen`. Only the first file that is present should be considered.
+The desktop environment MAY ignore Autoopen files altogether based on policy set by the user, system administrator, or vendor.
+An Autoopen file MUST contain a single relative path that points to a non-executable file contained on the medium. If the file contains a newline or carriage return character, then the newline or carriage return character itself and all characters that follow MUST be ignored.
+The desktop environment MUST verify that the relative path points to a file that is actually located on the medium, taking into account any symbolic or other links, and MUST ignore any relative path that points to a file location outside the medium itself.
+If the relative path points to an executable file then the desktop environment MUST NOT execute the file.
+When an Autoopen file has been detected and the user has confirmed that the file indicated in the Autoopen file should be opened, then the file indicated in the Autoopen file MUST be opened in the application normally preferred by the user for files of its kind UNLESS the user instructed otherwise.
#+AUTHOR: Mark Edgington <email@example.com>, John Palmieri <firstname.lastname@example.org>, Kévin Ottens <email@example.com>, Renato Caldas <firstname.lastname@example.org>, Rodrigo Moya <email@example.com>, Waldo Bastian <firstname.lastname@example.org>
This DRAFT document defines a method for automatically starting applications during the startup of a desktop environment and after mounting a removable medium.