X session autostart

Okay, I don't have GDM, but i'd like to start X right upon logging into shell. And here is the way you can do it. Edit your .bash_profile file (create one if you need):

if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
rm ~/.serverauth* 2>/dev/null
startx -- -br 2>/dev/null

This will allow you to start right when you log in in your tty1, the rest will stay as command line terminals.

No comments: