Start X at login
Revision as of 00:45, 16 May 2013 by Pilotkeller (Rewrote shell config to make it simpler and to avoid requiring $DISPLAY be empty. Also general neatness rewrite.)
|Summary help replacing me|
|Starting X automatically at login to a virtual terminal.|
|Automatic login to virtual console|
To manually start X,
startx is used, which will execute
~/.xinitrc, which may be customized to start the window manager of choice as described in the xinitrc article.
Shell RCConfig File
To easily accomplish this, add to your shell's rc config:
- Bash -
- Zsh -
- Csh -
- Ksh -
[[ $TTY == "/dev/tty1" ]] && exec startx
- This method can be combined with automatic login to virtual console.
- If you would like to remain logged in when the X session ends, remove
- To redirect the output of the X session to a file, create an alias:
alias startx='startx &> ~/.xlog'
- If you have a profile config (
~/.zprofile, etc...) place it in there instead to only run on successful logins.