<?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>2021-04-05</date>
<releaseinfo>&plasma; 5.20</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> for applications and login scripts, <filename class="directory">$HOME/.config/plasma-workspace/env</filename> for pre-startup scripts and <filename class="directory">$HOME/.config/plasma-workspace/shutdown</filename> for logout scripts to check what programs and scripts are already there and displays them. It allows you to manage them easily.
</para>

<para>Login scripts are <filename class="extension">.desktop</filename> files with a <literal>X-KDE-AutostartScript=true</literal> key. Pre-startup scripts are run earlier and can be used to set environment variables.
</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>

<sect2 id="disabling_autostart">
<title>Disabling Autostart Files Provided by Your Distribution</title>
<para>The correct way to disable an autostart item, for example the printer-applet if you use printer from time to time, is to copy its <filename class="extension">.desktop</filename> file to your personal autostart folder. Anything of the same name in <filename class="directory">$HOME/.config/autostart</filename> overrides the <filename class="extension">.desktop</filename> file in the default package. Add the following line to the copied <filename class="extension">.desktop</filename> file:</para>
<programlisting>
Hidden=true
</programlisting>
</sect2>

<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 or shutdowns.</para>

<variablelist>
<varlistentry><term><guilabel>Icon</guilabel></term>
<listitem>
<para>
This column shows the icon of the program or script you want to start with &plasma;. The icon is extracted from the Desktop file from the Icon key for a program and is the default icon for a script.
</para>
</listitem>
</varlistentry>

<varlistentry><term><guilabel>Name</guilabel></term>
<listitem>
<para>
This column shows the name of the program or script you want to start with &plasma;. The name is extracted from the <filename class="extension">.desktop</filename> file from the <literal>Name</literal> key for a program and is the filename for a script.
</para>
</listitem>
</varlistentry>

<varlistentry><term><guilabel>Properties</guilabel></term>
<listitem>
<para>
This button is only shown when you hover the item with the mouse pointer. The button (only enabled for programs and login scripts &ie; <filename class="extension">.desktop</filename> 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 or login script. The default command is extracted from the <filename class="extension">.desktop</filename> file from the <literal>Exec</literal> key.
</para>
<para>
For a logout script, the command is the path to the script and can not be modified.
</para>
</listitem>
</varlistentry>

<varlistentry><term><guilabel>Remove</guilabel></term>
<listitem>
<para>
This button is only shown when you hover the item with the mouse pointer. Pressing the <guibutton>&minus;</guibutton> button 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>
</variablelist>
</sect2>

<sect2 id="actions">
<title>Actions</title>
<para>
On the bottom, you have the combined <guibutton>Add...</guibutton> button to choose the type of item you want to add. You can add programs and login or logout scripts.
</para>

<variablelist>
<varlistentry><term><guimenuitem>Add Program</guimenuitem></term>
<listitem>
<para>
Clicking this item 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 <filename class="extension">.desktop</filename> file in your <filename class="directory">Autostart</filename> folder. 
</para>
</listitem>
</varlistentry>

<varlistentry><term><guimenuitem>Add Login Script...</guimenuitem></term>
<listitem>
<para>
This item opens a dialog that asks you for the location of the script you want to add. Scripts set to run on login will have a corresponding <filename class="extension">.desktop</filename> file created in your <filename class="directory">Autostart</filename> folder and will be run during Plasma startup.
</para>
</listitem>
</varlistentry>
<varlistentry><term><guimenuitem>Add Logout Script...</guimenuitem></term>
<listitem>
<para>
This item opens a dialog that asks you for the location of the script you want to add. Scripts set on to be run on logout 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>
</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;
-->
