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.
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". All keys should be interpreted as defined with the following exceptions in order to take into account that the .desktop files in an autostart directory are not shown in a menu.
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 exists 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.
Only one of these keys, either OnlyShowIn or NotShowIn, may appear in a single .desktop file.
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.
If an application autostarts by having a .desktop file installed in the system wide autostart directory, an individual user can disable the automatic start of this application by placing a .desktop file of the same name in its personal autostart directory which contains the key Hidden=true.