2

Getting Started

This chapter helps you start the X server, the first xterm (terminal emulator) window, and the mwm window manager. These processes may be started automatically when you log in, or you may have to start them manually.

In This Chapter:

Starting X

Logging On in the Special xdm Window

Logging In at a Full Screen Prompt

Starting X Manually

Starting the mwm Window Manager

Typing in a Window Once mwm is Running

2

Getting Started

Before you can begin using the X Window System, you must do three things:

  • Start the X server.
  • Start at least one xterm terminal emulator.
  • Start a window manager. (Although you can run X without a widow manager, this is fairly limiting.)

Depending on how X is configured on your system, some or all of these steps may be performed for you automatically. This chapter explains how you can tell if the X server, an xterm window, and the mwm window manager are being started automatically. This chapter also describes how to start these processes manually.

After you've started these preliminary processes, skip to the section “Typing in a Window Once mwm is Running,” later in this chapter.

Starting X

Depending on how X is being run on your system, the initial screens you see and the way you log in will be slightly different.

On some systems the display manager, xdm, starts X and keeps it running. If your system is set up to use xdm, you log on in a special window provided for that purpose. If xdm is running, you should never have to start X manually.

On some systems, you may be required to log in at a prompt displayed on the full screen. In these situations, X may or may not be started automatically when you log in. If X is not started automatically, you must start it yourself from the command line, as we'll describe later in this chapter.

Be aware that X is very easy to customize. There are countless command options as well as startup files that control the way the screen looks or even what menus a program displays. If X has been customized on your system, or you are trying out X using someone else's system or login account, things may not work exactly as described here. Customizing the X environment is introduced in Chapter 3, Working in the X Environment, and described in detail in Chapters 9 through 12.

Logging On in the Special xdm Window

If the display manager, xdm, is running X on your system, you'll probably see a window similar to Figure 2-1 when you turn on your terminal.

image

Figure 2-1. xdm login window

Log in just as if you were using a standard alphanumeric terminal. Without any user customization, the display manager executes a standard login “session,” providing the first xterm window and starting the window manager. The xterm window will be displayed in the upper-left corner of the screen. If the Motif window manager is running, you will see the characteristic frame around the xterm window, as in Figure 2-2. The name of the application (“xterm”) appears in the frame's title area.

image

Figure 2-2. Window frame indicates that mwm is running

The frame provides a quick and easy way to move, iconify, resize, and otherwise manage windows on the screen. Some of the basic window manager functions are introduced in the section “Raising, Moving, and Iconifying Windows” in Chapter 3.

If the mwm window manager is running, skip to the section “Typing in a Window Once mwm is Running,” later in this chapter. If the window manager is not running, skip to the section “Bringing Up the Window Manager,” for instructions on how to start it.

Be aware that, in addition to xdm, other display/session managers are commercially available. For example, Digital Equipment Corporation provides a display manager called dxsession, which functions similarly to xdm. If your system is using a display manager other than xdm, the login procedure may be slightly different. Also keep in mind that system administration tasks will vary depending on which display manager you use. Appendix A, System Management, describes the tasks involved in setting up the xdm display manager to run X.

Logging In at a Full Screen Prompt

If you log in at a prompt displayed on the full screen, your system is probably set set up to work in one of three ways. First, some workstations may be set up to start the server, open up the first xterm window, and possibly even start the window manager automatically. If all of these processes are running when you log in, the initial xterm window will be framed, as in Figure 2-2. Once the server, initial xterm, and the mwm window manager are running, you can skip to the section “Typing in a Window Once mwm is Running.”

Some systems are set up to start the server and initial xterm window when you log in, but not the window manager. If this is the case, your screen should then look something like the one in Figure 2-3.

image

Figure 2-3. Workstation with login xterm window on the root window

If you have an xterm window without a frame, you must start mwm yourself. Skip to the section “Starting the Window Manager” later in this chapter.

Be aware, however, that on some systems, X is not started automatically. When you log in at the prompt displayed on the full screen, no windows are opened; instead the entire screen functions as a single terminal, as shown in Figure 2-4.

image

Figure 2-4. Workstation functioning as a single terminal: X isn't running

If no windows are displayed when you log on at a full screen prompt, you must start the X Window System manually.

Starting X Manually

To start X manually, first make sure that the X11 directory containing executable programs is in your search path.* If not, add the pathname /usr/bin/X11 to the path set in your .profile or .login file.

If another windowing system (such as SunView™) is running, you must first kill it.

Then at the system prompt, enter:

% xinit

The xinit program starts the X server and creates the first xterm window in the upper-left corner of your display.* The xterm window indicates that X is running on your display. (In Appendix A, System Management, we'll show you how to set things up so that X comes up automatically.)

Starting the mwm Window Manager

To bring up the mwm window manager, you must enter the mwm command in the login xterm window. As described in Chapter 1, An Introduction to the X Window System, you can only provide input to one window at a time. X does not automatically know which window you want to type in, even if only one window appears on the display, as in Figure 2-3. In order to type in the xterm window on the display, you must first focus input to that window. The window to which input is focused is often referred to as the active window.

When no window manager is running, you focus input simply by moving the pointer so that the cursor symbol on the screen rests within the window. Depending on where the pointer rests, the cursor symbol representing it on the screen differs. When the pointer rests on the root window, it appears as a large X (another indication that X is running). When you move the pointer into the xterm window, it should change to what is known as the I-beam cursor symbol, which looks like a very thin letter “I”.

When you move the pointer into the xterm window, input is focused there. Notice that the rectangular text cursor changes from an outline to a solid color. The change in the text cursor is another indication that input is focused on the window. Once you've selected the xterm window as the active window, the characters you type will appear on the window's command line.

Start the mwm window manager by typing:

% mwm &

The screen will momentarily go blank. Then while mwm is starting up, the root window pointer changes to an hour glass that appears to be filling up with sand. When the hour glass is full, the xterm window will be redisplayed, this time with the characteristic frame, indicating that mwm is running.

Note that it is important to run mwm in the background by typing an ampersand (&) at the end of the command line so you can continue to enter additional commands in the xterm window. If you neglected to do this on a system that supports job control, type Control-Z to suspend mwm, then use the bg command (see csh(1)) to place it in the background.

If the system you're on does not support job control, interrupt the process using the appropriate key sequence (Control-C on many systems) and start over.

Typing In a Window Once mwm is Running

Now that you've started the X server, the first xterm window, and the mwm window manager, you'll want to proceed by entering commands in the xterm window. However, if you type some characters, you'll find that the keystrokes do not appear in the xterm—or anywhere else on the display!

In order to type in a window when mwm is running, you must first move the pointer into the window and click the first button. As described in Chapter 1, this focus policy is commonly referred to as click-to-type or explicit focus. (When mwm is not running, you select the window to receive input—the active or focus window—simply by moving the pointer into that window.) Until you select the xterm window as the window to receive input, any keystrokes are lost.

This feature of mwm can be even more confusing if mwm is not started automatically when you log in. Before you start the window manager, you can focus input on a window simply by moving the pointer. As described in the preceding section, you must move the pointer into the first xterm window in order to enter the mwm command. However, once you run mwm, the focus policy changes to click-to-type. If you try to type additional characters without clicking on the window, the keystrokes will be lost.

To select the focus window when mwm is running:

  1. Move the pointer into the xterm or other client window.
  2. Click the first pointer button. (To click a pointer button, you press it down and release it without pausing. Pointer actions are explained in the section “Using the Pointer” in Chapter 3.)

The color of the window frame will change in some way, indicating that the window has the input focus. (Once you are running several windows simultaneously, it's important to be able to identify the focus window easily.) The color of the active window's frame depends on the version of mwm you are running and the color resources for your system.

When you are using explicit (click-to-type) focus and the other default mwm resources, selecting a window to receive input also raises that window to the top of the window stack. As we'll see in Chapter 11, Customizing mwm, this behavior is controlled by an mwm resource variable called focusAutoRaise, which is true by default when explicit focus is in effect.

If you are working with a stack of windows that overlap, selecting a focus window automatically raises that window to the top of the stack (in effect the front of the display).

Keep in mind that mwm is highly customizable. You can specify dozens of features, including the color of the active window's frame, the options available on menus, and how certain window management functions are invoked. As we've discussed, one of the most significant modifications you can make to mwm is to change the focus policy from click-to-type (or explicit focus) to real-estate-driven (or pointer focus).

*For more information on how to set your search path, see Appendix A, System Management. Note that the appropriate pathname to add may be different in vendor distributions.

*If xinit produces a blank background with no terminal window, software installation was not completed correctly. Reboot your workstation and try again. Before invoking xinit, look in the directory /usr/bin/X11 for a file whose name begins with a capital X but otherwise has a similar name to your workstation (e.g., Xsun). When you find one that seems a likely possibility, try this command:

% xinit -- Xname

If that works, link Xname to X, and xinit will work correctly thereafter. For example:

% cd /usr/bin/X11
% ln Xsun X
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.122.4