# startx automatically if on first tty if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then startx logout fi