Linux Autostart: Difference between revisions

From wikinotes
No edit summary
 
 
Line 5: Line 5:


= On Shell Login =
= On Shell Login =
Put it in your shell's rcfile (ex: <code>~/.bashrc</code> .
Put it in your shell's rcfile, or .profile.
 
<syntaxhighlight lang="yaml">
sh:  ~/.shrc    ~/.profile
bash: ~/.bashrc   ~/.bash_profile
zsh:  ~/.zshrc    ~/.zprofile
</syntaxhighlight>


= On Graphical Login =
= On Graphical Login =

Latest revision as of 02:29, 18 July 2021

There are various ways of running jobs that run "on startup" on linux.

On Boot (before login)

Write a service for your job. You can manage it with your init system (ex: systemd, sysV, bsdinit, ...).

On Shell Login

Put it in your shell's rcfile, or .profile.

sh:   ~/.shrc     ~/.profile
bash: ~/.bashrc   ~/.bash_profile
zsh:  ~/.zshrc    ~/.zprofile

On Graphical Login

The method of running a script following user login depends on the Window-Manager you are using, and what method you are using to launch your window manager. I found it most useful to write a login shellscript, and call it in a method that is most appropriate to my environment.

  • put it in ~/.xinitrc
  • call it from your WM's configfile
  • create a .Desktop file and set it to autorun on login
  • other...