Start X at login
Typically, Template:Filename or Template:Filename are used to manually start X. Both will execute Template:Filename, which may be customized to start the window manager of choice as described in the xinitrc article.
The majority of users wishing to start an X server during the boot process will want to install a Display Manager instead.
or with additional checking (if tty1 (ctrl-alt-F1) shows an error message):
The user will be logged out when X is killed. In order to avoid this, remove the Template:Codeline part from the script.
Another way of circumventing display managers and booting straight into a preferred window manager or desktop environment involves editing Template:Filename, changing:
id:3:initdefault: [...] x:5:respawn:/usr/bin/xdm -nodaemon
id:5:initdefault: [...] x:5:once:/bin/su - -- PREFERRED_USER -l -c '/usr/bin/startx </dev/null'
The - option invokes a "login shell" by prepending a dash (-) to its name. Because a command is specified with the -c option, the shell is also run in "non-interactive mode". Bash does not do the normal login process in non-interactive login mode unless it is forced with the -l option. The -- option ensures that the -l and -c options are passed to the shell rather than used by su itself. These workarounds are needed for the combination of Gnu su and Bash; see "su 5.2.1 does not invoke bash as a login shell".
Additionally, Template:Codeline may be changed to any desired command or script. For example:
startx -- -nolisten tcp -br -deferglyphs 16
Also you can do this for multiple users using different runlevels,
x1:4:once:/bin/su - -- PREFERRED_USER1 -l -c '/usr/bin/startx </dev/null' x2:5:once:/bin/su - -- PREFERRED_USER2 -l -c '/usr/bin/startx </dev/null'
and inserting a new entries in GRUB menu.lst
# (0) Arch Linux title Arch Linux USER1 root (hd0,0) kernel /vmlinuz26 root=/dev/disk/by-label/Arch ro 4 initrd /kernel26.img # (1) Arch Linux title Arch Linux USER2 root (hd0,0) kernel /vmlinuz26 root=/dev/disk/by-label/Arch ro 5 initrd /kernel26.img
Note: if you have problems with writing non-ASCII letters terminals in that new X, remove the -l switch (see here).