Previous Section  < Day Day Up >  Next Section

Recipe 15.10. Configuring startx

15.10.1 Problem

You like to boot to the console and then run startx when you want an X session. But you need to know how to configure startx to start the desktop or window manager of your choice.

15.10.2 Solution

Edit .xinitrc in your home directory. This will start Gnome:

exec gnome-session

You can list all of your installed window managers and desktop environments:

exec gnome-session

#exec startkde

#exec icewm

#exec icewm-experimental

#exec afterstep

#exec enlightenment

#exec blackbox

Entering all of your installed window managers makes it easy to change the default by uncommenting the one you want. Be sure that only one is uncommented at a time.

15.10.3 Discussion

Gnome, KDE, and XFce should be started from their startup scripts—gnome-session, startkde, and startxfce—rather than their executables.

If a user has no ~/.xinitrc file, startx will look for the global .xinitrc, which will be tucked away somewhere in /etc, like /etc/X11/xinit/.xinitrc. X Windows file locations tend to be different on the various Linux distributions, so you might as well get used to hunting them down.

15.10.4 See Also

  • startx(1x)

    Previous Section  < Day Day Up >  Next Section