First draft, your feedback is highly appreciated.

Please send all comments to [EMAIL PROTECTED]

See http://lists.freedesktop.org/archives/xdg/2005-July/007061.html and follow 
ups for previous discussion.

Cheers,
Waldo

Title: Desktop Application Autostart Specification

Desktop Application Autostart Specification

John Palmieri


    
  

Renato Caldas


    
  

Waldo Bastian


    
  

Version 0.5.draft-1


Introduction

This DRAFT document defines a method for automatically starting applications during the startup of a desktop environment and after mounting removable media.

Some of the file locations in this specification are specified based on the "desktop base directory specification".

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.

Autostart Of Applications During Startup

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.

A desktop environment MUST NOT automatically start an application if the corresponding .desktop file has NOT been marked as executable.

TBD: Should non-executable files such as HTML or PDF files be supported as well?

Autostart Directories

The Autostart Directories are $XDG_CONFIG_DIRS/autostart as defined in accordance with the "Referencing this specification" section in the "desktop base directory specification".

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/

Application .desktop Files

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.

Hidden Key

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.

OnlyShowIn and NotShowIn Keys

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.

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.

Only one of these keys, either OnlyShowIn or NotShowIn, may appear in a single .desktop file.

TryExec Key

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.

Implementation Notes

A .desktop file can be marked as executable with chmod +x.

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.

TBD: What if we allow documents as well?

Autostart Of Applications After Mount

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.

A desktop environment MUST NOT execute an autostart file if the file has NOT been marked as executable.

The desktop environment MUST prompt the user for confirmation before automatically starting an application.

The desktop environment MAY ignore autostart files based on policy set by the user or system administrator.

Autostart Files

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.

TBD: Should the $CWD be set to the root directory?

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?

<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
                  "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd"; [
  <!ENTITY version "0.5.draft-1">
  <!ENTITY dtd-version "0.5">
				  ]>

<article id="index">
  <articleinfo>
    <title>Desktop Application Autostart Specification</title>
    <releaseinfo>Version &version;</releaseinfo>
    <date>4 July 2005</date>
    <authorgroup>
      <author>
	<firstname>John</firstname>
	<surname>Palmieri</surname>
	<affiliation>
	  <address>
	    <email>[EMAIL PROTECTED]</email>
	  </address>
	</affiliation>
      </author>
      <author>
	<firstname>Renato</firstname>
	<surname>Caldas</surname>
	<affiliation>
	  <address>
	    <email>[EMAIL PROTECTED]</email>
	  </address>
	</affiliation>
      </author>
      <author>
	<firstname>Waldo</firstname>
	<surname>Bastian</surname>
	<affiliation>
	  <address>
	    <email>[EMAIL PROTECTED]</email>
	  </address>
	</affiliation>
      </author>
    </authorgroup>
  </articleinfo>

  <sect1 id="introduction">
    <title>Introduction</title>
    <para>
      This DRAFT document defines a method for automatically starting
      applications during the startup of a desktop environment and after
      mounting removable media.
    </para>
    <para>
      Some of the file locations in this specification are specified based
      on the <ulink url="http://standards.freedesktop.org/basedir-spec/";>
      "desktop base directory specification"</ulink>.
    </para>
    <para>
     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.
    </para>
  </sect1>
  <sect1 id="startup">
    <title>Autostart Of Applications During Startup</title>
    <para>
      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.
    </para>
    <para>
      A desktop environment MUST NOT automatically start an application
      if the corresponding .desktop file has NOT been marked as executable.
    </para>
    <para>
      TBD: Should non-executable files such as HTML or PDF files be
      supported as well?
    </para>
    <sect2>
      <title>Autostart Directories</title>
      <para>
        The Autostart Directories are $XDG_CONFIG_DIRS/autostart as defined
        in accordance with the
        <ulink url="http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#referencing";>
        "Referencing this specification"</ulink> section in the
        <ulink url="http://standards.freedesktop.org/basedir-spec/";>
        "desktop base directory specification"</ulink>.        
      </para>
      <para>
        If the same filename is located under multiple Autostart Directories
        only the file under the most important directory should be used.
      </para>
      <informalexample>
        <para>
          Example: If $XDG_CONFIG_HOME is not set the Autostart Directory
          in the user's home directory is ~/.config/autostart/
        </para>
      </informalexample>
      <informalexample>
        <para>
          Example: If $XDG_CONFIG_DIRS is not set the system wide Autostart
          Directory is /etc/xdg/autostart/
        </para>
      </informalexample>
      <informalexample>
        <para>
          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/
        </para>
      </informalexample>
    </sect2>
    <sect2>
      <title>Application .desktop Files</title>
      <para>
        An application .desktop file must have the format as defined in
        the <ulink url="http://standards.freedesktop.org/desktop-entry-spec/";>
        "Desktop Entry Specification"</ulink>. 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.
      </para>
      <sect3>
        <title>Hidden Key</title>
        <para>
          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.
        </para>
      </sect3>
      <sect3>
        <title>OnlyShowIn and NotShowIn Keys</title>
        <para>
          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.
        </para>
        <para>
          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.
        </para>
        <para>
          Only one of these keys, either OnlyShowIn or NotShowIn, may appear
          in a single .desktop file.
        </para>
      </sect3>
      <sect3>
        <title>TryExec Key</title>
        <para>
          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.
        </para>
      </sect3>
    </sect2>
    <sect2>
      <title>Implementation Notes</title>
      <informalexample>
        <para>
          A .desktop file can be marked as executable with chmod +x.
        </para>
        <para>
          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.
        </para>
        <para>
          TBD: What if we allow documents as well?
        </para>
      </informalexample>
    </sect2>
  </sect1>
  <sect1 id="mounting">
    <title>Autostart Of Applications After Mount</title>
    <para>
      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.
    </para>
    <para>
      A desktop environment MUST NOT execute an autostart file 
      if the file has NOT been marked as executable.
    </para>
    <para>
      The desktop environment MUST prompt the user for confirmation before
      automatically starting an application.
    </para>
    <para>
      The desktop environment MAY ignore autostart files based on policy set
      by the user or system administrator.
    </para>
    <sect2>
      <title>Autostart Files</title>
      <para>
        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.
      </para>
      <para>
        TBD: Should the $CWD be set to the root directory?
      </para>
      <para>
        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?
      </para>
    </sect2>
  </sect1>

</article>

Attachment: pgpIDqITABMdO.pgp
Description: PGP signature

_______________________________________________
xdg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xdg

Reply via email to