Note: You can replace the -eq 1 comparison with one like -le 3 (for vt1 to vt3) if you want to use graphical logins on more than one VT.

Note: X must always be run on the same tty where the login occurred, to preserve the logind session. This is handled by the default /etc/X11/xinit/xserverrc.

Tips

This method can be combined with automatic login to virtual console. /!\ When doing this you have to set correct dependencies for the autologin systemd service to ensure that dbus is started before ~/.xinitrc is read and hence pulseaudio started. (cf this post)

If you would like to remain logged in when the X session ends, remove exec.