To automatically run programs:
- on bootup / shutdown, use systemd
- on user login / logout, use systemd/User services
- periodically at certain times, dates or intervals, use systemd/Timers or Cron
- once at a date and time, use systemd/Timers or
- on filesystem events use an inotify event watcher, like , or AUR
- on shell login / logout, see the article / documentation of your shell
- on Xorg startup, you can use:
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.
See also Wikipedia:Unix shell#Configuration files.
Upon login, all Bourne-compatible shells source
/etc/profile, which in turn sources any readable
*.sh files in
/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.