Autostart X on login to TTY1, with no display manager

Other talk about Salix
Post Reply
GJones
Donor
Posts: 300
Joined: 22. Jul 2011, 23:27

Autostart X on login to TTY1, with no display manager

Post by GJones »

This is how I generally handle starting X... I figured maybe some people here would be interested.

You just make sure that the xorg-xauth and xorg-xinit packages are installed, and put this in your ~/.profile:

Code: Select all

if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
        exec startx &> /dev/null
fi
In English, that would be something like:

Code: Select all

if the X server is not running and the virtual terminal is tty1 then
        replace the shell process with X, and send the output to /dev/null
So as soon as you log in to the first TTY, X instantly starts. You can still log into the other TTYs without X starting.

The benefits are fairly obvious; because some bloaty display manager isn't being loaded, you get faster boot times and less RAM usage. Not sure about the security though, using XDM might technically be more secure for work situations.

NB: if you have applications that make use of ConsoleKit, you may have to set your .xinitrc to launch it. Just replace

Code: Select all

exec $WINDOWMANAGER
with

Code: Select all

ck-launch-session $WINDOWMANAGER
No further changes are necessary, because Salix doesn't use PAM and therefore doesn't need you to mess around with pam_ck_connector.
Post Reply