Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Debian GNU/Linux Reference Guide
Prev Home Next

9.4.5 X sessions

An X session (X server + X client) can be started by:

  • startx: wrapper script command for xinit to start an X server and client from a Linux character console. If ~/.xinitrc does not exist, /etc/X11/Xsession is executed through /etc/X11/xinit/xinitrc.

  • xdm, gdm, kdm, or wdm: X display manager daemons to start the X server and client, and to control login via a GUI screen. /etc/X11/Xsession is directly executed.

The console can be made available as in "Let me disable X on boot!", Section 8.1.4. Custom X sessions

The default startup script /etc/X11/Xsession is effectively a combination of /etc/X11/Xsession.d/50xfree86-common_determine-startup and /etc/X11/Xsession.d/99xfree86-common_start.

Execution of /etc/X11/Xsession is somewhat affected by /etc/X11/Xsession.options and is essentially an execution of a program which was first found in the following order with the exec command:

  • ~/.xsession or ~/.Xsession, if it is defined.

  • /usr/bin/x-session-manager, if it is defined.

  • /usr/bin/x-window-manager, if it is defined.

  • /usr/bin/x-terminal-emulator, if it is defined.

  • The exact meaning of these commands is determined by the Debian alternative system described in Alternative commands, Section 6.5.3. For example:

         # update-alternatives --config x-session-manager
         ... or
         # update-alternatives --config x-window-manager

    In order to make any X window manager a default while keeping GNOME and KDE session managers installed, replace /etc/X11/Xsession.d/50xfree86-common_determine-startup with the one attached in the second bug report at (I hope this will be included soon) and edit /etc/X11/Xsession.options as follows to disallow the X session manager:

         # /etc/X11/Xsession.options
         # configuration options for /etc/X11/Xsession
         # See Xsession.options(5) for an explanation of the available options.
         # Default enabled
         # Default disabled (enable them by uncommenting)

    Without the above mentioned modification to the system, gnome-session and kdebase are the packages containing these X session managers. Removing them allows X window manager to be a default. (Yack, any better idea?)

    On a system where /etc/X11/Xsession.options contains a line allow-user-xsession without preceding characters, any user who defines ~/.xsession or ~/.Xsession will be able to customize the action of /etc/X11/Xsession.

    The last command in the ~/.xsession file should use form of exec some-window/session-manager to start your favorite X window/session manager.

    A good example of an ~/.xsession script is given at /usr/share/doc/xfree86-common/examples/xsession.gz.

    I use this to set the window manager, screen access, and language support for each user account. See Starting an X session for a user, Section, Getting root in X, Section 9.4.12, and Example for a multilingual X window system, Section 9.7.9.

    If you wish to have several X client programs started automatically, see X clients, Section 9.4.4 examples and invoke them from ~/.xsession instead of ~/.xinitrc.

    User-specific additional X resources can be stored in ~/.Xresources. See X resources, Section 9.4.10.

    User-customized keymaps and pointer button mappings in X can also be specified in the user's start up script. See Keymaps and pointer button mappings in X, Section 9.4.11. Starting an X session for a user

    Following the principle described at Custom X sessions, Section, a user-specific X session/window manager can be activated by installing the package indicated and setting the contents at the end of ~/.xsession file as follows. (I like blackbox/fluxbox for its simple style and fast speed.):

    • GNOME session manager (loaded)

      • Install package: gnome-session

      • exec /usr/bin/gnome-session

    • KDE session manager (loaded)

      • Install package: kdebase (or kdebase3 for KDE3)

      • exec /usr/bin/kde2

    • Blackbox window manager (lightweight, slick)

      • Install package: blackbox

      • exec /usr/bin/blackbox

    • Fluxbox window manager (lightweight, new blackbox)

      • Install package: fluxbox

      • exec /usr/bin/fluxbox

    • Xfce window manager (Mac OS-X, SUN CDE–like)

      • Install package: xfce

      • exec /usr/bin/xfwm

    • IceWM window manager (lightweight, GNOME alternative)

      • Install package: icewm

      • exec /usr/bin/X11/icewm

    • FVWM2 virtual window manager (lightweight, Win95-like)

      • Install package: fvwm

      • exec /usr/bin/fvwm2

    • Windowmaker window manager (somewhat NexT-like)

      • Install package: wmaker

      • exec /usr/bin/wmaker

    • Enlightenment window manager (loaded)

      • Install package: enlightenment

      • exec /usr/bin/enlightenment

    See Window Managers for X. Setting up KDE and GNOME

    In order to setup full KDE or GNOME environment, the following metapackages are useful:

    • KDE: install the kde package

    • GNOME: install the gnome package

    Installing these packages with tools which handle Recommends, such as dselect and aptitude, provides you with richer choices of software than just installing these with apt-get.

    If you want console login, be sure to disable X display managers, such as kdm, gdm, and wdm, which may be pulled in by the dependencies, as described in "Let me disable X on boot!", Section 8.1.4.

    If you want to have GNOME as the system default over KDE, make sure to configure x-session-manager as in Alternative commands, Section 6.5.3.

    Debian GNU/Linux Reference Guide
    Prev Home Next

      Published under the terms of the GNU General Public License Design by Interspire