Certification Objective 6.03: X Clients

 < Day Day Up > 



Once you've configured a working X Server, you are (almost) ready to start connecting to various X Window Client applications. An X Window Client is an application program. This client uses your X Server's graphical services to display output. While one X Server process controls the display, you can run as many X Clients as your hardware resources, primarily RAM, will support. If your Linux system is part of a network, you may also start X Clients on other systems on the network and have those clients send their displays to your X Server.

X Clients exist for almost every basic application. There are X Clients for word processing, spreadsheets, games, and more. The Red Hat GUI configuration tools were developed as X Clients. There are even X Client versions of popular utilities such as the emacs editor.

Default X Clients

When you configure a workstation for most users, you'll be configuring their GUI. You may need to specify a default desktop such as GNOME or KDE. I'll describe these desktops later in this chapter. You may want to set up specific applications to start automatically on a   user's desktop. Settings for default X Clients are stored in each user's home directory, in various hidden directories. In RHEL 3, KDE configuration files are stored in each user's ~/.kde directory (where the tilde, ~, represents a Linux home directory). GNOME configuration files are stored in hidden directories such as ~/.gconf, ~/.gnome, and ~/.gnome2.

Towards the end of this chapter, I'll show you the GUI tools that you can use to help you configure a workstation quickly during the Red Hat exams.

X Clients and Command Line Options

Starting an X Client is very easy. When you start the X Window System for the first time on RHEL 3, it puts X Client icons on the desktop by default. You can start additional X Clients by selecting a program from a menu, or you can start an X Client from a command line terminal screen. Later, I'll show you how to set up default X Clients when you start the Linux GUI.

It's almost as easy to start running X Clients from remote servers. All you need to do is give permission. As discussed later in this chapter, the xhost +client command on your Linux computer allows a remote computer named client to run X Clients on your local X Server.

On The Job 

You may wish to reread and practice with the commands in this section after reading the next section on the Remote Display of X Applications.

X Clients are standard Linux applications, which you can start with commands such as xclock, xeyes, xterm, xclipboard, etc. If you choose to start an X Client from a command line, you can follow the command name with any number of options. Most X Clients understand a common set of options. These options are used to control such things as the size and location of the X Client's window, the font the application uses to display the text, and even the display on which the application should display its output. Table 6-1 lists some of the more useful options you can supply when you start an X Client from the command line.

Table 6-1: Common X Client Command Line Options

Option

Example

Result

-display server:0.0

-display frodo:0.0

Send output to the X Server running on the computer named frodo.

-geometry XSIZE×YSIZE+XOFF+YOFF

-geometry 100×100+10+20

Specify the size and location of the window. In this case, we want a window 100×100 pixels in size, offset from the upper-left corner by 10 pixels horizontally and 20 pixels vertically.

-font fontname

-font lucidasans-14

Display text for this client using a specific font.

-background color

-background blue

Set the window background to blue.

-foreground color

-foreground white

Set the window foreground to white.

-title string

-title 'My Window'

Place a title on the client window's title bar.

-bordercolor color

-bordercolor green

Make the window border green.

-borderwidth pixels

-borderwidth 5

Make the window border 5 pixels wide.

The behavior of most of the command line options in Table 6-1 is self-descriptive, but we need to take a more detailed look at how some of the options work. We will examine the -display option in more detail when we look at running remote X Clients.

The -geometry option is used to specify both the size of the window that the X Client starts up in and the location of the window. Notice that the first two numbers, the XSIZE and the YSIZE, are separated by a lowercase 'x.' These two numbers specify the size of the client window in either pixels or characters, depending on the application. For example, if you are opening an xterm window, the size represents a terminal screen with XSIZE columns and YSIZE lines. If you are starting an xclock, the size represents a window XSIZE×YSIZE in pixels.

The next two numbers specify where you want the client window to appear on your display. The numbers are relative to the upper-left and lower-right corners of the desktop: +0+0 represents the upper-left corner, -0-0 represents the lower-right corner. These specs are shown in Table 6-2.

Table 6-2: X Client Geometrical Positioning

XSIZExYSIZE

Description

-0-0

Lower-right corner

-0+0

Upper-right corner

+0-0

Lower-left corner

+0+0

Upper-left corner

Therefore, for XOFF+YOFF, if you specify +10+10, the client is positioned 10 pixels from the left edge of the screen and 10 pixels from the top of the screen. Alternatively, -10-10 positions the client 10 pixels from the right edge of the screen and 10 pixels up from the bottom of the screen.

The -font option specifies the font that the X Client should use to display text. The X Window System comes with a wide variety of both fixed and proportionally spaced fonts. The default list is located in the /usr/X11R6/lib/X11/fonts directory. This directory contains a number of subdirectories, each of which contains font files for the various types of fonts installed on your system.

Many of the X Client command line options enable you to specify colors for different parts of the client window. You can specify a simple color such as red, green, white, and black. Alternatively, you can specify a color by indicating the red, green, and blue components of the color:

# xclock -background RGB:FF/00/FF

xterm

One of the most useful X Clients is a program called xterm. As its name implies, xterm is an X Client application that creates a terminal window on your X display. So, after all the hard work you've gone through to get a nice windowing display, you're right back where you started, with a command line interface.

The difference is that now you can start up as many of these command line interfaces as you like, and you can switch between them with the click of a mouse. Since xterm is an X Client, you can even open terminal windows on other computers on your network and have them display to your desktop. You can start xterm either from a menu or from a command line prompt.

While the two major desktops include their own versions of xterm, Red Hat has configured gnome-terminal as the default command-line interface within the default GNOME desktop. It is what is started when you right-click on the desktop and select New Terminal from the pop-up menu.

On The Job 

In RHEL 3, the default GUI command line interface for the KDE desktop is konsole, which you can start when you right-click on the desktop and select Open Terminal from the pop-up menu. Functionally, you can run commands in konsole just as you can run commands within gnome-terminal.



 < Day Day Up > 



RCHE Red Hat Certified Engineer Linux Study Guide[c] Exam (Rh302)
RCHE Red Hat Certified Engineer Linux Study Guide[c] Exam (Rh302)
ISBN: 71765654
EAN: N/A
Year: 2003
Pages: 194

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net