Yes its true - Linux does have a GUI, "just like Windows", you might say. Its not absolutely necessary to be stuck to the command line while using Linux, you can use the system very effectively using a GUI, complete with themes, desktop management, drag and drop, the whole nine yards in fact. The GUI has finally reached such a stage that now it is even possible to play 3D games, watch movies, create professional graphics, use IDE's for program development, etc. But you can be pretty sure that you will be attracted by the powerful CLI (ie, the Command Line Interface) as well once you get used to it.
Anyway, there is a lot more to the Linux GUI than just point-and-click. The whole thing is based on a big, well thought out architecture that affords features to the user that one could have only imagined. So we will take a step-by-step approach to this. This chapter only talks about the basic hardware setup involved and a brief introduction to the concept of a Desktop Environment. Other things will be described in later chapters dedicated to those topics.
One important limitation about using Linux on the desktop has been then apparent lack of support for multimedia components like sound cards and video cards. But Linux has come a long way in terms of support for these multimedia devices. Most installations will detect your sound and video cards and select the correct drivers accordingly. One thing to keep in mind is that you might need to have your hardware documentation at hand - things like the make and model of your card, various specifications, etc.
The display system in Linux is managed by a big suite of external software called the X-Windows System. It includes driver support for a large number of devices, which is regularly updated and increased by developers. Actual configuration of display devices is extremely easy, due to the existence of configuration utilities. In case that fails, the settings can even be made manually. If the hardware is not detected automatically, the user may have to provide details like keyboard type, mouse, monitor frequencies, size of video RAM, etc. These can be easily found in the hardware manuals.
In case the display cannot be configured during installation, no need to dispair! Its best to continue with the installation anyway. The display settings can always be created later using the utilitites listed below. These can also be used to reconfigure to the display settings even if the one's created during installation work correctly.
The Xconfigurator is the simplest of these utilities. In order to setup the display, all the user has to do is to type the command Xconfigurator at the superuser prompt. This is normally invoked during installation itself, but it can be used later to tweak the settings as well. The utility tries to detect the hardware and match it with a pre-existing database. In case the hardware is correctly detected, appropriate settings are made. Also a number of dialogs are presented to the user, such as required screen resolution, color depth and whether Linux should boot into a GUI mode directly.
When Xconfigurator is unable to detect the hardware, or cannot figure out the correct settings, you can fall back on a second utility called xf86config. This is basically a script that provides the user with an interface to specify all the necessary settings manually. A series of questions are asked about the hardware and the user has to provide the correct information. If all goes well, a new configuration is generated which should hopefully work correctly!
A large amount of documentation is already available on this in the form of HOWTO's, FAQ's etc. The best way to get help on setting up your hardware is to consult a local Linux Users Group, where someone is bound to have already faced any problem you might have. Its useful if you can provide information about what the X-server (ie, display system) reported before dying, if at all it started in the first place. Its also advisable to check the FAQ if the group has a mailing list, since such topics are discussed a lot and people don't usually like to start the threads all over again!
Most of the tweaking involved is concerned with a single file, /etc/X11/XF86Config, where a few options might need to be changed. It helps to check out the XFree86 Home Page for a list of currently supported hardware. Some vendors may also provide their own drivers, such as the one's for the Intel 810 chipset.
Sound support is built directly into the Linux kernel, most commonly in the form of sound modules created along with the kernel. A stock kernel installation in any Linux distribution contains support for a lot of common sound devices. The sndconfig utility provides a way to configure the module for the device on the user's machine. The utility will try to detect the sound card present, and select the correct module to be plugged into the kernel. If it can't detect the sound card, it asks the user to provide more information. Again, its most likely that the sound card will be auto-detected, but its good to have the documentation handy anyway.
In Linux, the display is handled by a client server architecture called the X Windowing System. It is based on the X protocol developed in 1980's to satisfy the need for a network transparent graphical user interface to Unix systems. X clients typically run on a remote machine which has excess computing power, while the displays are handled by an X server which may be running on a machine with good graphics abilities. In effect, the X protocol hides the peculiarities of the operating system and the underlying hardware, so that an application running on one machine can actually display its interface on some other machine! In case of the desktop, both the server and the clients are running on the same machine, so that network support isn't too important.
The X Window System that is most commonly used on all Linux systems is XFree86, which is a free implemetation of X. Once the necessary hardware settings have been made using Xconfigurator, the X system can be brought up using the startx script. In addition, the X GUI can be made the default interface of the system by edition some initialisation options, which are discussed elsewhere.
The actual GUI is provided in the form of a Desktop Environment which is responsible of providing the actual functionality of the Linux Desktop. The Desktop Environment provides background processes, standard libraries and a general framework for various applications to work. The Environment will take care of all the things needed for the applications to interact with each other and respond to user-generated events. An example is drag-and-drop, where data is passed from one application to another by simple use of the mouse. This cannot be accomplished unless the Desktop Environment provides a standard way of exchanging data between applications, and of interpreting the actions of the user through the mouse.
The handling of windows on the screen is handled by a separate entity called the window manager. This provides the individual controls and features of the windows, along with desktop management. Examples are Enlightenment, IceWM, etc. The window manager that you choose for your system will determine how all the windows on your screen look and behave. This is different from the concept of "themes", which only define the overall appearance. The window manager is supposed to take care of the actual behaviour of the windows, like the response to user clicks, minimise and maximise events, moving the windows around, etc. The themes are in fact supported by both, the Desktop Environment as well as the window manager; the user can select either of the two.
Another important component is the widget set or the toolkit that provides most common widgets for the GUI, ie, buttons, text boxes etc. This is used by the application programmers to create the necessary interface for their application. For example, GNOME uses the GIMP Tool Kit, called gtk+ while KDE is based on the Qt library. Since a single widget set is used in a particular environment, all the applications will have the same appearance. But this is one part that the end-user need not be concerned with, its the developers who are more intereted in this. If you plan to create a GUI based app, the first place you need to start looking is probably the selection of the widget set that you will use to create the windows, forms, etc.
Now the world of Linux is teeming with a lot of Desktop Environments, but quite a few have emerged as the favourites - GNOME, KDE, xfce, etc. Of these GNOME and KDE are the most ambitious projects that aim to deliver a whole lot of power to the Linux Desktop. Already a large number of commercial ventures have sprung up around these two environments. Whichever environment you choose, they provide comparable features in terms of applications, performance, etc. But only problem is that they have taken off in totally different directions, and hence interoperability between the two is very less. Thus, the wonderful mail client that you liked so much in one environment might simply not work in another!
The KDE was the first of the two, based on the Qt widget set created by a company called TrollTech. But the licensing scheme involved in the project was such that it was not entirely free software. So the GNOME project was started in response, to create a truly free GUI for the GNU/Linux system. But the license problems have been resolved eversince so that the competition is now based on technical details like performance, features, applications etc.
Rather than recommending any one environment, its better if the user tries out all the different choices available in Linux land before deciding on what they like best. Some people use a particular environment simply because they have always used that one and don't see a need to switch to any other! We will look at the features and services available with each one in later chapters.