Pages

September 09, 2007

*nix and GUI

When you install a Windows or OS X system, you get a big, integrated package that gives you a graphical user interface, a desktop with a trashcan, a system of standard windows, etc. All the bits that make this happen seem to magically work together to give you the OS's experience, and it all happens without the user having any idea exactly what's going on.

This is so not the *nix way. Part of the *nix philosophy is to write something that does one thing, but does it well. Then that one thing gets used in a bigger thing that does one (bigger) thing well, and that thing used in another, etc. This is a fairly common development methodology, but the difference when it comes to *nix is that all the little bits that make up a Big Thing are released as independent entities, very frequently with access to the underlying source code.

This has a few interesting ramifications. The biggest is that it facilitates iterative refinement of sub-modules. Since a sub-module is a distinct entity from the higher-level entity that uses it, someone can refine the sub-module without having to keep things in sync with people maintaining the higher-level entity. Another is that it minimizes the need to duplicate effort. If you (as a programmer) have access to a widget that, say, lets you do all sorts of neat networking things, then you don't have to develop the code that does that yourself.

This is all very interesting if you are a programmer, but if you have no interest in developing *nix programs then why should you care? Well, if your interest is only in using your computer, then it will still have impact your life. The biggest of these is that you will need get used to the idea that things you used to think of as monolithic entities are actually made up of smaller bits that you will have to deal with independently.

The most important example of the above is the way *nix systems set up graphical user interface environments. In a Windows or OS X install, you get a massive package that delivers a complete graphical user experience. However, in the case of *nix, it's all broken into its various little bits, the most important of which are listed below.

Most *nix GUI-based systems have the following components:

A window system. A window system provides your computer and OS a bare-bones way of making graphics go. It gives other programs a standard way of interfacing with a system's graphical abilities. The most common *nix window system specification is the X Window System, and the most recent version of this protocol is called X11. The two most popular open source implementations of X11 are X.Org and XFree86.

A window manager. A window system provides only a very basic way of communicating with a computer's graphics system. A window manager builds on this by providing the kinds of window features we are all used to now: windows with title bars that have "close", "minimize", and similar buttons, etc. You only need to install one window manager to make the system go; in spite of this, there are billions and billions of different *nix window managers, each trying to address some niche scenario and/or let a programmer prove his/her mettle. Some popular window managers for the X Window System are Blackbox, Fluxbox, FVWM, IceWM, Openbox, and Sawfish.

File managers. A file manager lets you browse and (typically) open files installed on your system. Popular *nix file explorers include PCMan File Manager, ROX-filer, Thunar, XFE, Konquerer, and Nautilus.

Taskbars and pagers. Windows users are used to having a taskbar at the bottom of the screen to help with launching programs and keeping track of what's open. OS X users have a menu bar at the top of the screen and a Dock at the bottom that serve a similar purpose. These kinds of things are independent entities in the *nix world. Popular *nix taskbars and pagers include bbpager, fbpanel, F***inf Small Panel, PyPanel, GNOME Panel, PerlPanel, and Xfce4 Panel.

Display managers. Do you want to be able to login to your computer using a graphical user interface? Then you will need a display manager: GDM, KDM, and XDM are popular examples.

Misc. Do you want to put icons on your desktop? Then you will need a program that makes that happen. Do you want a trashcan? Then you will need a program that implements that as well. Do you want a screensaver? I think you are beginning to get the idea.

Integration
Many popular window managers break with the strict *nix tradition of compartmentalizing functionality and instead integrate some of the above functions. For example, Fluxbox and IceWM have their own built-in taskbars. Going even beyond this, there are packages that incorporate most of the above functionality into a complete comprehensive desktop environment, which is what Windows and Macintosh have been doing all along. The most popular *nix desktop environments are GNOME, KDE, and Xfce.

Most Linux distributions include a default desktop environment, usually GNOME or KDE. For example, Ubuntu is based on GNOME and Kubuntu is based on KDE. This approach simplifies things for the end-user by delivering in one integrated package the basic GUI features that many users have come to expect. The downside to GNOME and KDE is that, like Windows XP/Vista and Mac OS X, they are resource intensive. On a low-end machine, these environments will deliver very slow performance. Xfce (used in Xubuntu) is less resource hungry than GNOME or KDE, but even it is a bit too heavy for many older machines.

Why-oh-why?
The conventional way of installing a GUI system on *nix is a tweaky process. That is a big turn-off for many users, your grandmother in particular. However, it does let you create a custom mix of all the various bits and pieces that make up the desktop experience using only the most efficient but still usable alternatives. And that will let us build a modern, solid and usable system that runs on obsolete hardware.

No comments: