HOWTO: StartX automatically on Login – Ubuntu

03Oct10

For those wanting a lightweight system, Gnome applications like GDM are simply too big.

Here’s a quick and simply way to startup your graphical environment automatically from the command line login, be it Gnome or Openbox.

This howto comes with help from the Arch Wiki.

First open up a terminal (Applications>Accessories>Terminal) and type

sudo cp /etc/skel/.profile ~/

This copies a skeleton bash .profile to your home directory. Next, open it up with your preferred text editor or simply use

nano ~/.profile

Next, type the following at the bottom of the script, or if you can copy and paste, copy the following, and use Shift+Ctrl+Ins to paste it.

#Startx Automatically
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
 . startx
 logout
fi

If using nano, press Ctrl+X then Shift+Y to exit and save.

That’s it. When you reboot next, simply type in your user name and password, and X will start up automatically.



2 Responses to “HOWTO: StartX automatically on Login – Ubuntu”

  1. 1 Just Me

    just what I was looking for :)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.

Join 41 other followers