<?xml version="1.0" ?>
<!DOCTYPE article PUBLIC "-//KDE//DTD DocBook XML V4.5-Based Variant V1.1//EN"
"dtd/kdedbx45.dtd" [
  <!ENTITY % addindex "IGNORE">
  <!ENTITY % English "INCLUDE">
]>
<article id="autostart" lang="&language;">
<articleinfo>
<title>Autostart</title>
<authorgroup>
<author>&Anne-Marie.Mahfouf;</author>
<!-- TRANS:ROLES_OF_TRANSLATORS -->
</authorgroup>

<date>2018-03-25</date>
<releaseinfo>&plasma; 5.12</releaseinfo>

<keywordset>
<keyword>KDE</keyword>
<keyword>System Settings</keyword>
<keyword>autostart</keyword>
<keyword>desktop file</keyword>
<keyword>script file</keyword>
</keywordset>
</articleinfo>

<sect1 id="kcm_autostart">
<title>Autostart Manager</title>

<para>This module is a configuration tool for managing what programs start up with your personal &plasma;. It allows you to add programs or scripts so they automatically run during startup or shutdown of your &plasma; session and to manage them.</para>

<note><para>Please note that in this module all changes are immediately applied.</para></note>

<para>The program scans <filename>$HOME/.config/autostart/</filename>,
<filename class="directory">$HOME/.config/plasma-workspace/env</filename> and <filename class="directory">$HOME/.config/plasma-workspace/shutdown</filename> folders to check what programs and scripts are already there and displays them. It allows you to manage them easily.
</para>

<note><para>Note that you can change the location of your <filename class="directory">Autostart</filename>
folder in <menuchoice><guimenu>Applications</guimenu> <guimenuitem>Locations</guimenuitem></menuchoice> 
in the <guilabel>Personalization</guilabel> category of the &systemsettings; and set a different folder 
than <filename class="directory">$HOME/.config/autostart</filename>.</para></note>

<para>Please read also <ulink url="help:/kcontrol/kcmsmserver">Desktop Session</ulink> and <ulink url="help:/kcontrol/kded">Background Services</ulink> for information how to configure the startup behavior of your &plasma; session.</para>

<para>Some &kde; applications handle the autostart behavior on their own, &eg; you can enable or disable autostart of an application in the settings dialog (&kalarm;) or you have to use <menuchoice><guimenu>File</guimenu><guimenuitem>Quit</guimenuitem></menuchoice> (&konversation;, &kopete;), otherwise the application is still running in the systemtray and will be restarted on next login.
</para>

<sect2 id="migration">
<title>Migration from &kde; Workspaces 4</title>
<para>To migrate your personal autostart setting from &kde; Workspaces 4:</para>
<simplelist>
<member>Copy desktop files from <filename class="directory">$HOME/.kde/Autostart</filename> to <filename class="directory">$HOME/.config/autostart</filename></member>
<member>Copy pre startup script files from <filename class="directory">$HOME/.kde/Autostart</filename> to <filename class="directory">$HOME/.config/plasma-workspace/env</filename></member>
<member>Copy shutdown script files from <filename class="directory">$HOME/.kde/Autostart</filename> to <filename class="directory">$HOME/.config/plasma-workspace/shutdown</filename></member>
</simplelist>
</sect2>

<!--FIXME Disabling Autostart Files Provided By Your Distribution -> http://www.sharpley.org.uk/node/8 -->

<sect2 id="current">
<title>Files display</title>
<para>The main part of the module displays the programs that are loaded when &plasma; starts and scripts that are run when &plasma; starts, shutdowns or before &plasma; starts.</para>

<variablelist>
<varlistentry><term><guilabel>Name</guilabel></term>
<listitem>
<para>
You cannot amend this column. It states the name of the program or script you want to start with &plasma;. The name is extracted from the Desktop file from the Name key for a program and is the filename for a script.
</para>
</listitem>
</varlistentry>

<varlistentry><term><guilabel>Command</guilabel></term>
<listitem>
<para>
This column lists the commands that are run to start the program. Commands for a program can be modified through the <guibutton>Properties</guibutton> button or by double clicking the program row. The command is extracted from the Desktop file from the Exec key.
</para>
<para>
For a script the command is the path to the script and can not be modified.
</para>
</listitem>
</varlistentry>

<varlistentry><term><guilabel>Status</guilabel></term>
<listitem>
<para>
This setting is only available for programs through Desktop files. You can keep a program in the <filename class="directory">Autostart</filename> folder but disable it from being run at &plasma; start. Unchecking the status <guilabel>Enabled</guilabel> the program will not run on start.
</para>
<para>
Unchecking the status <guilabel>Enabled</guilabel> sets the Desktop file Hidden property to true in the <filename class="directory">Autostart</filename> folder.
</para>
</listitem>
</varlistentry>

<varlistentry><term><guilabel>Run On</guilabel></term>
<listitem>
<para>
Programs (Desktop files) can only be run on startup. Scripts can be run on <guilabel>Startup</guilabel>, <guilabel>Shutdown</guilabel> or <guilabel>Before session startup</guilabel>. This column allows you to change when your script is run. Startup is when &plasma; starts, shutdown is when you log out of &plasma; and before session startup is before &plasma; starts. 
</para>
<para>
Scripts and desktop files set to run on <guilabel>Startup</guilabel> are copied or symlinked in <filename class="directory">$HOME/.config/autostart</filename> and will be run during &plasma; startup.
</para>
<para>
Scripts set on to be ran on <guilabel>Shutdown</guilabel> are copied or symlinked in the <filename class="directory">$HOME/.config/plasma-workspace/shutdown</filename> directory and will be automatically run during &plasma; shutdown after the user has logged out.
</para>
<para>
Scripts set to run at <guilabel>Pre-&plasma; Startup</guilabel> are copied or symlinked in <filename class="directory">$HOME/.config/plasma-workspace/env</filename> and are sourced during &plasma; startup (the <filename>startkde</filename> script will look for scripts here).
</para>
<note><para>
Only scripts with the <filename class="extension">.sh</filename> extension can be read by &plasma; for <guilabel>Before session startup</guilabel> and <guilabel>Shutdown</guilabel> modes.
</para></note>
</listitem>
</varlistentry>
</variablelist>
</sect2>

<sect2 id="actions">
<title>Actions</title>
<para>
On the bottom you have some buttons to change the way Autostart is configured. You can add programs or scripts, remove them or change their properties.
</para>

<variablelist>
<varlistentry><term><guibutton>Add Program</guibutton></term>
<listitem>
<para>
Clicking this button displays the standard &plasma; <guilabel>Choose Application</guilabel> dialog and allows you to choose which program you want to start. After choosing the program, clicking <guibutton>OK</guibutton> brings you the properties for this program. 
</para>
<para>
This will copy the program Desktop file in your <filename class="directory">Autostart</filename> folder. 
</para>
</listitem>
</varlistentry>

<varlistentry><term><guibutton>Add Script</guibutton></term>
<listitem>
<para>
This button opens a dialog which asks you for the location of the script you want to add. If you keep <guilabel>Create as symlink</guilabel> checked (default) then the script will be added as a symlink. If you uncheck this option then the script will be copied to the corresponding local folder.
</para>
</listitem>
</varlistentry>
<varlistentry><term><guibutton>Remove</guibutton></term>
<listitem>
<para>
Remove will immediately remove the Desktop file for the program or the script or symbolic link in the <filename class="directory">Autostart</filename> folder.
</para>
</listitem>
</varlistentry>
<varlistentry><term><guibutton>Properties</guibutton></term>
<listitem>
<para>
This button (only enabled for programs &ie; Desktop files) allows you to change the properties of the program or script. You have general properties, permissions properties, a preview when applicable and properties related to the application for programs.
</para>
</listitem>
</varlistentry>
<varlistentry><term><guibutton>Advanced</guibutton></term>
<listitem>
<para>
This button only applies to programs (&ie; Desktop files). A dialog asks you if you want the program to autostart only in &plasma; (and not in other desktop environments you might run). By default, the program will autostart in all desktop environments you might run. Checking <guilabel>Autostart only in Plasma</guilabel> will autostart the program only if you start the &plasma; desktop environment.
</para>
<para>
This sets the value Plasma to the OnlyShowIn key of the program Desktop file.
</para>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>
</article>

<!--
Local Variables:
mode: xml
sgml-minimize-attributes:nil
sgml-general-insert-case:lower
sgml-indent-step:0
sgml-indent-data:nil
End:

vim:tabstop=2:shiftwidth=2:expandtab
kate: space-indent on; indent-width 2; tab-width 2; indent-mode none;
-->
