Difference between revisions of "Start X at login"

From ArchWiki
Jump to: navigation, search
m (Reverted edits by Sambul13 (talk) to last revision by Kynikos)
(fix double redirect)
(101 intermediate revisions by 38 users not shown)
Line 1: Line 1:
[[Category:X Server]]
#REDIRECT [[Xinit#Autostart_X_at_login]]
[[Category:Boot process]]
[[es:Start X at Boot]]
[[hu:Start X at Boot]]
[[it:Start X at Boot]]
[[pt:Start X at Boot]]
[[ru:Start X at Boot]]
[[th:Start X at Boot]]
[[zh-CN:Start X at Login]]
{{Article summary start}}
{{Article summary text|Starting X automatically at login to a virtual terminal.}}
{{Article summary heading|Related}}
{{Article summary wiki|Automatic login to virtual console}}
{{Article summary wiki|Display Manager}}
{{Article summary wiki|Xinitrc}}
{{Article summary end}}
A [[Display Manager|display manager]] can be used to provide a login screen and start the [[X server]]. This article explains how this can be done using an existing virtual terminal.
To manually start X, {{ic|startx}} or {{ic|xinit}} are used. Both will execute {{ic|~/.xinitrc}}, which may be customized to start the window manager of choice as described in the [[xinitrc]] article.
== shell profile file ==
{{Note|This runs X on the same tty used to login, which is required in order to maintain local permissions.}}
For bash, add the following to the bottom of {{ic|~/.bash_profile}}. If the file does not exist, copy a skeleton version from {{ic|/etc/skel/.bash_profile}}.
For zsh, add the following to {{ic|~/.zprofile}} instead.
{{hc|shell profile file|<nowiki>
vt=$(fgconsole 2>/dev/null)
(( vt == 1 )) && exec startx -- vt$vt &> ~/.xlog
unset vt
The user will be logged out when X is killed. In order to avoid this, remove the {{ic|exec}} part from the script. Also note the redirection of the output to {{ic|~/.xlog}}.
{{Tip|This method can be combined with [[automatic login to virtual console]] to provide autologin.}}

Latest revision as of 10:37, 24 July 2016