Difference between revisions of "Autostarting"

From ArchWiki
Jump to navigation Jump to search
(fixed section fragments (interactive))
(Tag: wiki-scripts)
m (On window manager startup: maybe not most, but many)
 
(30 intermediate revisions by 7 users not shown)
Line 1: Line 1:
[[Category:Boot process]]
+
[[Category:System administration]]
 
[[es:Autostarting]]
 
[[es:Autostarting]]
 
[[ja:自動起動]]
 
[[ja:自動起動]]
 
[[ru:Autostarting]]
 
[[ru:Autostarting]]
 
[[zh-hans:Autostarting]]
 
[[zh-hans: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.
+
{{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 start your scripts or applications as daemons, see [[Daemon]]. 
+
== On bootup / shutdown ==
  
=== Systemd ===
+
Use [[systemd]] services.
  
''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]]. To autostart scripts for specific users, see [[systemd/User]].
+
== On user login / logout ==
  
== Cron ==
+
Use [[systemd/User]] services.
  
[[Cron]] can be used to autostart non-GUI system setup tasks.
+
== On device plug in / unplug ==
  
== File-system changes ==
+
Use [[udev]] rules.
  
{{Pkg|inotify-tools}} can be used to execute commands or scripts on [[Wikipedia:inotify|inotify]] events, triggered by file-system changes. See [https://techarena51.com/index.php/inotify-tools-example/ some examples].
+
== On time events ==
  
Other tools that use the same underlying functionality are {{Pkg|incron}} and {{AUR|fswatch}}.
+
Periodically at certain times, dates or intervals:
  
== Shells ==
+
* [[systemd/Timers]]
 +
* [[Cron]]
  
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 files]] or [[Zsh#Startup/Shutdown files]].
+
Once at a date and time:
  
See also [[Wikipedia:Unix shell#Configuration files for shells]].
+
* [[systemd/Timers]]
 +
* {{Pkg|at}}
  
=== /etc/profile ===
+
== On filesystem events ==
  
Upon login, all Bourne-compatible shells source {{ic|/etc/profile}}, which in turn sources any readable {{ic|*.sh}} files in {{ic|/etc/profile.d/}}: these scripts do not require an interpreter directive, nor do they need to be executable. They are used to set up an environment and define application-specific settings.
+
Use an [[Wikipedia:inotify|inotify]] event watcher:
  
== Graphical ==
+
* {{Pkg|inotify-tools}}, see {{man|1|inotifywait}}
 +
* [[Incron]]
 +
* {{AUR|fswatch}}
  
You can autostart programs automatically when you login into your [[Window manager]] or [[Desktop environment]].
+
== On shell login / logout ==
  
=== X session startup ===
+
See [[Command-line shell#Configuration files]].
  
See [[xinitrc]] and [[xprofile]].
+
== On Xorg startup ==
  
=== Desktop entries ===
+
* [[xinitrc]] if you are starting [[Xorg]] manually with [[xinit]].
 +
* [[xprofile]] if you are using a [[display manager]].
  
See [[Desktop entries#Autostart]].
+
== On desktop environment startup ==
  
=== GNOME ===
+
Most [[desktop environment]]s implement [[XDG Autostart]].
  
See [[GNOME#Startup applications]].
+
If the desktop environments has an article, see its ''Autostart'' section.
  
=== KDE Plasma ===
+
* [[GNOME#Autostart]]
 +
* [[KDE#Autostart]]
 +
* [[Xfce#Autostart]]
 +
* [[LXDE#Autostart]]
 +
* [[LXQt#Autostart]]
  
See [[KDE#Autostarting applications]].
+
== On window manager startup ==
  
=== Xfce ===
+
Many [[window manager]]s implement [[XDG Autostart]].
  
See [[Xfce#Startup applications]].
+
If the [[window manager]] has an article, see its ''Autostart'' section.
  
=== LXDE ===
+
* [[Fluxbox#Autostart]]
 
+
* [[Openbox#Autostart]]
See [[LXDE#Autostart]].
+
* [[Awesome#Autostart]]
 
+
* [[i3#Autostart]]
=== LXQt ===
 
 
 
See [[LXQt#Autostarting applications]].
 
 
 
=== Fluxbox ===
 
 
 
See [[Fluxbox#Autostart programs]].
 
 
 
=== Openbox ===
 
 
 
See [[Openbox#autostart]].
 
 
 
=== Awesome ===
 
 
 
See [[Awesome#Autorun programs]].
 

Latest revision as of 21:10, 28 May 2019

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 device plug in / unplug

Use udev rules.

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

Most desktop environments implement XDG Autostart.

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

On window manager startup

Many window managers implement XDG Autostart.

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