Difference between revisions of "Autostarting"

From ArchWiki
Jump to: navigation, search
(Openbox: covered in the linked article)
(change Boot process category to System administration as it's more fitting)
 
(73 intermediate revisions by 23 users not shown)
Line 1: Line 1:
[[Category:Boot process]]
+
[[Category:System administration]]
 
[[es:Autostarting]]
 
[[es:Autostarting]]
This article links to various methods to launch scripts or applications automatically when some particular event is taking place, like system startup or shutdown, shell login or logout and so on.
+
[[ja:自動起動]]
 +
[[ru:Autostarting]]
 +
[[zh-hans:Autostarting]]
 +
{{Related articles start}}
 +
{{Related|Daemons}}
 +
{{Related articles end}}
  
== Daemons ==
+
This article links to various methods to launch scripts or applications automatically when some particular event is taking place.
You can easily start your scripts or applications as daemons, see [[Daemon]].
 
  
=== Systemd ===
+
== On bootup / shutdown ==
''systemd'' is the default init framework, replacing initscripts. The services which are started by ''systemd'' can be found in the subfolders of {{ic|/etc/systemd/system/}}. Services can be enabled using the {{ic|systemctl}} command. For more information about ''systemd'' and how to write autostart scripts for it, see at [[systemd]].
 
  
=== Runit ===
+
Use [[systemd]] services.
''runit'' is a mature init system which offers process supervision, parallel startup, per-user service trees, granular cgroup manipulation, flexible dependency system, and boot times that don't incur the penalty of dbus. The root-level services are symlinks in {{ic|/service}} with the actual service directories in {{ic|/etc/sv}}. See the [[Runit]] page for more information.
 
  
== Shells ==
+
== On user login / logout ==
  
To autostart programs in console or upon login, you can use shell startup files/directories. Read the documentation for your shell, or its ArchWiki article, e.g. [[Bash#Configuration file sourcing order at startup]] or [[Zsh#Autostarting applications]].
+
Use [[systemd/User]] services.
  
See also [[Wikipedia:Unix shell#Configuration files for shells]].
+
== On time events ==
  
=== /etc/profile ===
+
Periodically at certain times, dates or intervals:
  
{{ic|/etc/profile}} is sourced by all Bourne-compatible shells upon login: it sets up an environment upon login and application-specific settings by sourcing any readable {{ic|/etc/profile.d/*.sh}} scripts.
+
* [[systemd/Timers]]
 +
* [[Cron]]
  
== Graphical ==
+
Once at a date and time:
You can autostart programs automatically when you login into your [[Window Manager]] or [[Desktop Environment]].
 
  
=== X session startup ===
+
* [[systemd/Timers]]
 +
* {{Pkg|at}}
  
See [[xinitrc|~/.xinitrc]] and [[xprofile|~/.xprofile and /etc/xprofile]].
+
== On filesystem events ==
  
=== X Desktop Group ===
+
Use an [[Wikipedia:inotify|inotify]] event watcher:
  
The {{ic|$XDG_CONFIG_DIRS/autostart/}} and {{ic|$XDG_CONFIG_HOME/autostart/}} folders contain {{ic|*.desktop}} files, which are executed every time an X session starts, determining which programs are loaded for which desktop environment. For an explanation of the desktop file standard refer to [http://standards.freedesktop.org/desktop-entry-spec/latest/ Desktop Entry Specification].
+
* {{Pkg|inotify-tools}} (see [https://techarena51.com/index.php/inotify-tools-example/ some examples])
 +
* [[Incron]]
 +
* {{AUR|fswatch}}
  
=== GNOME, KDE, Xfce ===
+
== On shell login / logout ==
  
[[GNOME]], [[KDE]] and [[Xfce]] all have a dedicated GUI for autostart settings, see the respective articles.
+
See [[Command-line shell#Configuration files]].
  
==== KDE (Legacy) ====
+
== On Xorg startup ==
  
KDE also has a specific folder: {{ic|~/.kde/Autostart}} or {{ic|~/.kde4/Autostart}}
+
* [[xinitrc]] if you are starting [[Xorg]] manually with [[xinit]].
 +
* [[xprofile]] if you are using a [[display manager]].
  
=== LXDE ===
+
== On desktop environment startup ==
  
See [[LXDE#Autostart programs]].
+
If the [[desktop environment]] has an ArchWiki article, see its ''Autostart'' section.
  
=== Fluxbox ===
+
* [[GNOME#Autostart]]
 +
* [[KDE#Autostart]]
 +
* [[Xfce#Autostart]]
 +
* [[LXDE#Autostart]]
 +
* [[LXQt#Autostart]]
  
See [[Fluxbox#Autostarting Applications]].
+
Most desktop environments implement [[XDG Autostart]].
  
=== Openbox ===
+
== On window manager startup ==
  
See [[Openbox#Startup programs]].
+
If the [[window manager]] has an ArchWiki article, see its ''Autostart'' section.
 +
 
 +
* [[Fluxbox#Autostart]]
 +
* [[Openbox#Autostart]]
 +
* [[Awesome#Autostart]]

Latest revision as of 10:46, 24 April 2018

This article links to various methods to launch scripts or applications automatically when some particular event is taking place.

On bootup / shutdown

Use systemd services.

On user login / logout

Use systemd/User services.

On time events

Periodically at certain times, dates or intervals:

Once at a date and time:

On filesystem events

Use an inotify event watcher:

On shell login / logout

See Command-line shell#Configuration files.

On Xorg startup

On desktop environment startup

If the desktop environment has an ArchWiki article, see its Autostart section.

Most desktop environments implement XDG Autostart.

On window manager startup

If the window manager has an ArchWiki article, see its Autostart section.