<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Desktop Application Autostart Specification</title><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="article" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="index"></a>Desktop Application Autostart Specification</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="surname">Palmieri</span></h3><div class="affiliation"><div class="address"><p><br>
            <code class="email">&lt;<a href="mailto:johnp@redhat.com">johnp@redhat.com</a>&gt;</code><br>
          </p></div></div></div><div class="author"><h3 class="author"><span class="firstname">Renato</span> <span class="surname">Caldas</span></h3><div class="affiliation"><div class="address"><p><br>
            <code class="email">&lt;<a href="mailto:seventhguardian_@hotmail.com">seventhguardian_@hotmail.com</a>&gt;</code><br>
          </p></div></div></div><div class="author"><h3 class="author"><span class="firstname">Waldo</span> <span class="surname">Bastian</span></h3><div class="affiliation"><div class="address"><p><br>
            <code class="email">&lt;<a href="mailto:bastian@kde.org">bastian@kde.org</a>&gt;</code><br>
          </p></div></div></div></div></div><div><p class="releaseinfo">Version 0.5.draft-1</p></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#introduction">Introduction</a></span></dt><dt><span class="sect1"><a href="#startup">Autostart Of Applications During Startup</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id2497769">Autostart Directories</a></span></dt><dt><span class="sect2"><a href="#id2453323">Application .desktop Files</a></span></dt><dt><span class="sect2"><a href="#id2453404">Implementation Notes</a></span></dt></dl></dd><dt><span class="sect1"><a href="#mounting">Autostart Of Applications After Mount</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id2453467">Autostart Files</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="introduction"></a>Introduction</h2></div></div></div><p>
      This DRAFT document defines a method for automatically starting
      applications during the startup of a desktop environment and after
      mounting removable media.
    </p><p>
      Some of the file locations in this specification are specified based
      on the <a href="http://standards.freedesktop.org/basedir-spec/" target="_top">
      "desktop base directory specification"</a>.
    </p><p>
     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.
    </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="startup"></a>Autostart Of Applications During Startup</h2></div></div></div><p>
      By placing an application's .desktop file that is marked as executable
      in one of the autostart directories the application will be
      automatically lauched during startup of the user's desktop environment.
    </p><p>
      A desktop environment MUST NOT automatically start an application
      if the corresponding .desktop file has NOT been marked as executable.
    </p><p>
      TBD: Should non-executable files such as HTML or PDF files be
      supported as well?
    </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2497769"></a>Autostart Directories</h3></div></div></div><p>
        The Autostart Directories are $XDG_CONFIG_DIRS/autostart as defined
        in accordance with the
        <a href="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#referencing" target="_top">
        "Referencing this specification"</a> section in the
        <a href="http://standards.freedesktop.org/basedir-spec/" target="_top">
        "desktop base directory specification"</a>.        
      </p><p>
        If the same filename is located under multiple Autostart Directories
        only the file under the most important directory should be used.
      </p><div class="informalexample"><p>
          Example: If $XDG_CONFIG_HOME is not set the Autostart Directory
          in the user's home directory is ~/.config/autostart/
        </p></div><div class="informalexample"><p>
          Example: If $XDG_CONFIG_DIRS is not set the system wide Autostart
          Directory is /etc/xdg/autostart/
        </p></div><div class="informalexample"><p>
          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/
        </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2453323"></a>Application .desktop Files</h3></div></div></div><p>
        An application .desktop file must have the format as defined in
        the <a href="http://standards.freedesktop.org/desktop-entry-spec/" target="_top">
        "Desktop Entry Specification"</a>. 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.
      </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2453345"></a>Hidden Key</h4></div></div></div><p>
          A .desktop file with the Hidden key set to true should be
          ignored in such a way that if multiple files with the same filename
          exist and the .desktop file in the most important location has
          the Hidden key set to true, all other .desktop files with the same
          name should be ignored as well.
        </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2453360"></a>OnlyShowIn and NotShowIn Keys</h4></div></div></div><p>
          The OnlyShownIn 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.
        </p><p>
          The NotShownIn 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.
        </p><p>
          Only one of these keys, either OnlyShowIn or NotShowIn, may appear
          in a single .desktop file.
        </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2453386"></a>TryExec Key</h4></div></div></div><p>
          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 a relative path. In case of a
          relative path the $PATH environment is searched to find a matching
          executable program.
        </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2453404"></a>Implementation Notes</h3></div></div></div><div class="informalexample"><p>
          A .desktop file can be marked as executable with chmod +x.
        </p><p>
          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 its personal autostart directory
          which contains the key Hidden=true.
        </p><p>
          TBD: What if we allow documents as well?
        </p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="mounting"></a>Autostart Of Applications After Mount</h2></div></div></div><p>
      When a desktop environment mounts a new media, the media may contain
      an autostart file that is marked as executable that can suggest to
      start an application or to open a specific file on the media.
    </p><p>
      A desktop environment MUST NOT execute an autostart file 
      if the file has NOT been marked as executable.
    </p><p>
      The desktop environment MUST prompt the user for confirmation before
      automatically starting an application.
    </p><p>
      The desktop environment MAY ignore autostart files based on policy set
      by the user or system administrator.
    </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2453467"></a>Autostart Files</h3></div></div></div><p>
        When a new media is mounted the root directory of the media should
        be checked for the following files in order of precendence: 
        .autorun, autorun, autorun.sh Only the first file that is
        present should be considered.
      </p><p>
        TBD: Should the $CWD be set to the root directory?
      </p><p>
        TBD: This is only practical for starting applications that are on
        the media itself. Should there be a convenient way to open e.g.
        a .html or .pdf file using the users preferred application for
        such file type?
      </p></div></div></div></body></html>