<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" type="topic" style="task" id="autostart-applications" lang="fa">

  <info>
    <link type="guide" xref="software#management"/>
    <revision pkgversion="3.30" date="2019-02-08" status="draft"/>

    <credit type="author copyright">
      <name>یانا سواروا</name>
      <email>jana.svarova@gmail.com</email>
      <years>۲۰۱۳</years>
    </credit>
    <credit type="author copyright">
      <name>پیتر کوار</name>
      <email>pknbe@volny.cz</email>
      <years>۲۰۱۴</years>
    </credit>

    <license xmlns="http://projectmallard.org/1.0/" href="https://creativecommons.org/licenses/by-sa/3.0/">
  <p>This work is licensed under a <link href="https://creativecommons.org/licenses/by-sa/3.0/">Creative
  Commons Attribution-ShareAlike 3.0 Unported License</link>.</p>
</license>

    <desc>How can I add an autostart application for all users?</desc>
  </info>

  <title>Add an autostart application for all users</title>

  <p>To start an application automatically when the user logs in,
  you need to create a <file>.desktop</file> file for that application in the
  <file>/etc/xdg/autostart/</file> directory.</p>

<steps>
  <title>To add an autostart application for all users:</title>
  <item><p>Create a <file>.desktop</file> file in the
  <file>/etc/xdg/autostart/</file> directory:</p>
<code>[Desktop Entry]
Type=Application
Name=<var>Files</var>
Exec=<var>nautilus -n</var>
OnlyShowIn=GNOME;
AutostartCondition=<var>GSettings org.gnome.desktop.background show-desktop-icons</var></code>
  </item>
  <item><p>Replace <var>Files</var> with the name of the application.</p></item>
  <item><p>Replace <var>nautilus -n</var> with the command you wish to use to
  run the application.</p></item>
  <item><p>You can use the <code>AutostartCondition</code> key to check for a
  value of a GSettings key.</p>
  <p>The session manager runs the application automatically if the key's value
  is true. If the key's value changes in the running session, the session
  manager starts or stops the application, depending on what the previous value
  for the key was.</p>
</item>
</steps>

</page>
