Almost every page I've found is about to automatically start Xorg after login wihout explianation, take ~/.bash_profile for example:
if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then exec xinit fi I suppose $XDG_VTNR could be a variable for obtaining the current TTY number, however, there is already a command called tty, which can meet the same purpose.
My questions:
- What is
$XDG_VTNR? Where and when is it being set? - Where can I find the official documentation about this variable?
ttyis a built-in command while$XDG_VTNRis provided by Xorg, why people choose to use$XDG_VTNRinstead of built-intty?