Edit (23.07.2008) - See Addendum under X-Window System
============
WWW resource:
Debian X Window System FAQ:
http://soc.if.usp.br/doc/xfree86-common/FAQ.xhtml
O'Reilley Open Book on-line: Learning Debian GNU/Linux By Bill McCarty, Chp 6. Using the X Window System:
http://www.oreilly.com/catalog/debian/c ... 06_01.html
===========================================
Something that I have kept in my documentation section with some edited updates:
This is a generalised documentation on the X-Window System installed in your Debian distribution and is aimed toward mainly those who are just getting around the Debian installed X-Window System from the non-graphical command line style, or from a login manager, XDM and for those who tired of 'googling' for info. So if you like to start your X window manager or desktop by typing 'startx' (or via XDM) there are a few things to make it easier for you. This will be mainly about (1)making your window manager or desktop environment the default system on login, and (2) running multiple X sessions.
Some background on X-Window System, window manager & desktop environment:
X-Window System:
================
In Linux, almost everything is text-based as opposed to graphical-user-interfaces (GUIs) for example in MS Windows. There are several advantages of running a text-based system in Linux, for example if you run a server it save PC resources that would otherwise be wasted running a GUI system, or if you run a really old and/or slow PC like I, a GUI-based system hog resources. In a reasonably fast and modern PC, this wouldn't be a factor and you can run all the GUIs you want without breaking sweat. So, it is down to mostly individual and organisational preference.
In Linux (and also UNIX, FreeBSD etc) the GUI runs on the top of the text-based system, the GUI is call the X-Window System or X. If you don't know it already, X-Window System in Linux takes care of things like the hardware settings such as the monitor (refresh rate & resolution), keyboard, and mouse, so the graphical application just "communicate" with the X-Window System and tell it want it want to do.
In the current stable version of Debian, Sarge 3.1, the X Window System, is called XFree86, while in the soon to be stable version of Debian, Etch 4.0, the X Window System, is called X.org. The X.org is a fork of XFree86 and the latter will probably be discontinued in term of supports.
Addendum:
========
Reference: X-Power Tools -Chris Tyler:
The xorg.conf Configuration File:
The xorg.conf configuration file is divided into five basic sections (and there are eight optional sections; see Section 3.6). Knowing the purpose of each of these sections is the key to understanding the xorg.conf file.
ServerLayout:
Defines how the screens and input devices are combined to form a display configuration.
Screen:
Combines one video card (or Device in xorg.conf terminology) and one Monitor to form a screen. This section also defines the color depth and resolution(s) to be used on that screen.
Monitor:
Describes the characteristics of the monitor - whether it supports DPMS and what scan rates are permissible.
Device:
Configures the video card.
InputDevice:
Contains configuration information for an input device. There are usually at least two of these sections—one for a pointing device and one for a keyboard.
Each Screen section brings together a Monitor and Device section, and each ServerLayout section brings together one or more Screen sections with two or more InputDevice sections.
Multiple ServerLayout sections are used to handle alternate configurations—forexample, a laptop configuration file could have one server layout for use on the road and a different server layout for use at the office.
Window managers:
===============
When you have the X-Window System installed and configured in your PC, start it up by typing 'startx' from the command line, you will be greeted by a grey screen with a small box with black background. It is a bit ugly and boring. The small box is the xterm terminal. The X.org (or XFree86) has a 'focus-follow-mouse' behaviour, i.e., wherever your mouse cursor points, that is where your keyboard input goes.
If your X.org or XFree86 failed to start, check the output errors. If you received one of the most common error messages like this
no screens found, it is most likely to be incorrectly configured video card or monitor settings. Run this command as root (su or sudo):
Either in Etch:
or in Sarge:
walk through the configurations and answer each question correctly and if in doubt leave the setting alone. If you still receive the error, instead of autodetection try manually select the VESA driver. If this failed to work, post your problem on this message board on the appropriate trend to get expert help.
It is all very well having X-Window System, however you need a software that takes care of handling the windows, this is where the window manager comes in. The latter controls how your desktop look and act, the decorations, moving, hiding, resizing, and closing etc. There are huge numbers of window managers available today for Debian. Many of them provided things like menus, application launchers, virtual desktops, GUIs and so on, and they are all highly configurable and flexible.
Desktop environments:
====================
While the window manager provides almost everything that you need, sometimes you might want to have the "full monty" and go for a desktop environment instead. The latter will give you literally everything that you would like to have on a PC. This is most likely what you'll started out with. The most popular desktop environments in Linux world are KDE, and Gnome. However, these two need a window manager as well. KDE has its own window manager while Gnome doesn't.
For full detail see guide to window managers and desktop environments for X:
http://xwinman.org/
=========================================
Making your window manager or desktop the default:
=========================================
If you have more than one window managers/desktop, you should be able to switch between them easily and also to make a window manager/desktop the default at login. If you have a graphical login manager like KDM or GDM, this is easy to do; however if you use XDM or start from the command line by running 'startx', there's a way to do so:
You need to edit either the ~/.xinitrc or ~/.xsession file that is located in your home directory. If you start your window manager/desktop from command line with 'startx', you need to edit the ~/.xinitrc
file otherwise if you use XDM, you need to edit the ~/.xsession file.
1. For ~/.xinitrc file: Open the ~/.xinitrc file with your favourite text editor, e.g. by typing
If you do not have ~/.xinitrc in your directory you need to create one using the same command as above.
If you already have a ~/.xinitrc file, it will have a lot of text file, make a backup, e.g. by typing
2. Add a line like this to your file:
#!/bin/sh
exec
yourwindowmanager/desktop
where
yourwindowmanager/desktop is the command that starts the window manager or desktop you want to be your default. As an example, mine is
#!/bin/sh
exec fluxbox
You can use "exec /usr/bin/fluxbox", as it will call to the default path /usr/bin unless you installed the fluxbox executable elsewhere. After editing the ~/.xinitrc file, save and exit from the editor. In the command line you simply type "startx" and your default window manager will start.
3. For ~/.xsession file: You need to edit this file if you have a graphical login like XDM. The latter display manager is not configurable like the KDM or GDM, so you will have to edit the ~/.xsession file manually in the same way as the ~/.xinitrc file. The ~/.xsession file as with ~/.xinitrc is also located in your home directory, so open your favourite text editor and edit it in the same
way as ~/.xinitrc in step 2 above. If you do not have a ~/.xsession file, then create one. Save and exit from the text editor, either restart or reboot and your default window manager or desltop will starts up
the next time you log in via XDM.
Some commands for starting window manager or desktop:
Gnome: gnome-session
KDE: startkde
Xfce4+: startxfce4
Enlightenment E16: enlightenment
Enlightenment DR17: enlightenment_start
FVWM: fvwm
FVWM2: fvwm2
Window Maker: wmaker
IceWM: icewm
====================
Running Multiple X-sessions
====================
1. You can run two or more X-Window System sessions simultaneously and on different virtual terminals..
The first X session that you start runs on screen 0 by default, however, you can run a second X session on screen 1, a third on screen 2, a fourth on screen 4, etc. To run a second X session on screen 1, type (if you're using command line to login to your X session):
To run X session on screen 2,
etc.
2. You can switch between X sessions. On a default Linux configuration, you have command line sessions running on your first six virtual terminals. Your first X session is running on the seventh virtual terminal (screen 0). If you're running only one X session, all the terminals after terminal seven are empty. The virtual terminals config (gettys) is located in your /etc/inittab file, e.g. mine is:
Code: Select all
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
# 4:23:respawn:/sbin/getty 38400 tty4
# 5:23:respawn:/sbin/getty 38400 tty5
# 6:23:respawn:/sbin/getty 38400 tty6
Note: Because I don't really need all of these virtual terminals and they tend to take up memory, so I made a backup of this file and disabled the three virtual terminals by commenting out getty 6, 5 and 4.
So in my case, the second X session runs in virtual terminal eight, the third session in virtual terminal nine, and so on. You can switch between X screens the same way you switch between virtual terminals by pressing the keys Ctrl+Alt and the F key with the desired terminal's number.
So to switch from screen 0 to screen 1, i.e., from the first X session to the second X session, you need to press the keys "Ctrl+Alt+F8", to go back to the first X session, you press the keys, "Ctrl+Alt+F7".
In X window system, the default screen is 0 so some applications may not work well when using other screens. For example if you type an application like "gimp" at the command line, it will run in screen 0 even though you're doing so from another screen. In order to run on the screen that you launch the applications from you need to specify a command line option, so for example to run Gimp on screen 2:
You can actually launch the application from any X session or virtual terminal you want and send it to any X screen. You could actually switch between different window managers, resolution etc, for example, you can run an X session with different color depth than the default one:
This will allow you to run a second X session with a 8 bpp colour depth.