home " subscribe " advertise " customer service " back issues " " contacts

Sections
  Newbies
  Reviews
  How To
    Best Defense
    Guru Guidance
    On The Desktop
  Developer's Den
    Gearheads Only
    Compile Time
    Perl of Wisdom
  Who's Who
 
Indexes
  Issue Archive
  Author Index
 
Linux Magazine
  Subscribe
  Advertise
  Customer Service
  Back Issues
  
  Contacts
 
On Stands Now Click to view Table of Contents for Linux Magazine March 2000 Issue
 
Subscribe to Linux Magazine

Linux Magazine / July 1999 / NEWBIES
The X Window System
 
       page 01 02   next >>

NEWBIES
The X Window System
by Hal Moroff

The last two months, this column provided an overview of Linux and a step-by-step installation process. This month, we're going tell you a little about Linux's windowing interface -- The X Window System.

The Root User

When you start Linux, you first have to identify yourself to the computer by logging on. This allows each user to have his own individual account or workspace that he may customize to his liking. This also protects users and their files from each other. Sharing is allowed, but that's a whole different subject. There is one special user known as the "superuser", whose login name is "root" and whose password is selected when the operating system is first installed. The superuser is allowed to change any file anywhere on the system. This is important because you need to login as root to fix things if something goes wrong. You should not login as root during normal use of the computer, as it's far too easy to make mistakes that can damage the system. It also opens your computer up to security problems when you connect to the Internet. However, for the purposes of this article (since we have not yet discussed how to add more users) we will be logging in as root. (Just be aware that this is not something you generally want to do).

Windows

After logging in as "root", your command prompt will look like this:

[root @localhost /root]#

Now, this certainly doesn't look anything like Windows did, but have no fear. What you're looking at is a "command line interface". In this type of interface, you type commands to the computer one at a time.

What you're probably used to is an interface with "windows" that lets you use a mouse to "point and click". This is called a "windowing interface". Microsoft Windows is one windowing interface. It is not the only one, however. Linux has one available, and it's known as "The X Window System" (or usually just "X"). The free version of X that comes with Linux is known as "XFree86".

While there's not much you can do if you don't like the "look and feel" of Microsoft Windows (other than change the color of the background and window borders), you can customize X rather extensively. With X, you can make cosmetic changes like changing the size and style of window borders, as well as non-cosmetic changes, like changing the option in a menu. One of my pet peeves about Windows is that in order to type in a given window, you must click in that window and move it to the front of the screen. It then obscures any other windows on the screen. With X, you can change that behavior if you don't like it. In fact, there are so many things you can change with X that it is easy to be overwhelmed with the number of options. Fortunately, X distributions come with some default setups, and you should feel comfortable with at least one of them.

I won't get into detail on how X works; it's not important right now. But there is one concept that is useful to understand. When you use X, you are using two main pieces of software -- a client and a server.

Say, for example, that you are using a word processor under X. Some software has to be responsible for the actual drawing of a box on the screen where the text is going to appear and also the drawing of the text itself. Some other software is going to be concerned with what words you've typed and what font you expect to see (the actual word processing functions). It's natural that these two functions be separate, and in fact they are. The "X server" software is concerned with your display screen -- drawing boxes and shapes, watching where the mouse is pointing, and what buttons if any are pressed. The XFree86 program itself is the "X server". The word processor is an "X client;" it only cares about reading what you type and figuring out what the output should look like. It's called a client because it makes requests of the server, as in "server please display this text in my window".

Window Managers (Part One)

So we know that the X server watches the mouse's movement and draws a pointer as you drag it across the screen. But how does the server know that you want blue borders around the windows and that the screen background color should be turquoise? How does it know which window you want to be on top? Well, that's decided by another piece of client software called the "window manager". This software determines how X will "look and feel". X allows you to change window managers at any time and thus completely change the look and feel of your system. Additionally, almost all window managers let you customize their individual look.

This all may sound rather complicated, and it's certainly not something you had to deal with in Windows. But try a few window managers on your Linux computer and you'll appreciate being able to choose the style of interface that you want.

There are lots of popular window managers available, and you can download most of them from the Internet. Red Hat Linux comes with more than four. It's very easy to change from one to another and decide which one you like.

Now that we've discussed a little about how X works, let's start it up.

Starting X

Starting X is simple. For now we'll do it from the command line. Later, you can set things up so X starts automatically. To start X, just type

startx

at the command line and press the enter key. The screen will go blank at first, and X may take several seconds to start up. While you wait, keep reading; there are three commands I want to tell you about right away. These are "ctl-alt-+", "ctl-alt­" and "ctl-alt-back".

For our purposes, "ctl-alt-+" refers to pressing simultaneously the "ctrl" key, the "alt" key, and the "+" key on the numeric keypad. Similarly, "ctl-alt­" refers to the "ctrl" key, the "alt" key, and the "­" key on the numeric keypad; and "ctl-alt-back" refers to the "ctrl" key, the "alt" key, and the "backspace" key.

The first two commands are used to switch display resolutions. Let me explain what I mean by that: In Microsoft Windows, when you click on "Display" in the control panel and then click on the "Settings" tab in the "Display" window, you get something like Figure 1.

Newbies NT Display 1
FIGURE 1

In the part labeled "Desktop Area". you can set different screen sizes or "resolutions". Of course changing this setting does not change the size of your physical screen, instead it changes the size of what's displayed on it. I like to pack a lot of information onto my screen, and I don't mind if the features are small, so I set mine to "1280 by 1024." If I want bigger icons and larger text, I can always change this later.

You can do the same thing under X. During your Linux installation, you told the system what kind of graphics card and monitor you have. X probed those to decide what resolutions your computer could probably handle. If it decided that your computer could handle more than one, then you can change from one to another by pressing "ctl-alt-+" or "ctl-alt--". If X thinks your system can handle only one resolution, then these commands will do nothing.

The command "ctl-alt-back" is used to get out of X and return to the command line. If you've waited patiently for X to start, but your screen is still blank and you suspect that something is wrong, then press "ctl-alt-back" and you should come back to the command line prompt. X may not be configured correctly on your system and we should diagnose that.


       page 01 02   next >>
 
Linux Magazine / July 1999 / NEWBIES
The X Window System

home " subscribe " advertise " customer service " back issues " " contacts