Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

The fvwm2 Window Manager

The fvwm2 window manager (shown in Figure 5.24) has a configurable taskbar, 3D window frames, buttons, scrollbars, and the capability for extensive customization. Customized configurations of this window manager have been the basis of several complex and popular X desktops provided with Red Hat Linux in the earlier Red Hat distributions (such as TheNextStep and AnotherLevel).

This window manager's default startup file is found under the /etc/X11/fvwm2 directory as system.fvwm2rc. Copy this file to your home directory as .fvwm2rc and make changes to customize your X sessions. To use fvwm2, insert its name in your .xinitrc file and use the startx command to start your X session.

05fig24.jpg

Figure 5.24 The fvwm2 window manager has basic window manager features, such as a pager for its virtual desktops.

fvwm2's startup file contains sections for customizing window colors and styles, menus, keyboard actions, and the number of virtual desktops. Look for the desktop section, which looks like this:

DeskTopSize 2x2

fvwm2's default startup file defines four different virtual desktops. By changing the DeskTopSize value, you can either reduce or increase the number of virtual desktops. For example, use a setting like this to add another two desktops:

DeskTopSize 2x3

When you restart fvwm2, you'll see that an additional two desktops have been added to the fvwm2 pager window. You can move to a different desktop by pressing your left mouse button on the appropriate square in the desktop pager's window. However, another modification you can make that can be a lifesaver, especially if your computer's mouse is broken or you want to use just the keyboard for moving the pointer, is to insert definitions to enable your cursor keys to shift to different desktops or to move the pointer!

Scroll through your .fvwm2rc file until you find the default Key definitions:

# some simple default key bindings:
Key Next         A       SCM     Next [*] Focus
Key Prior        A       SCM     Prev [*] Focus

Add the following cursor key definitions:

# Shift + Ctrl moves 1 page in direction
Key Left        A       CS       Scroll -100 +0
Key Right       A       CS       Scroll +100 +0
Key Up          A       CS       Scroll +0 -100
Key Down        A       CS       Scroll +0 +100

These definitions define Shift+Ctrl+CursorX, which will shift your desktop to the next available desktop in X direction. This means that you can move between desktops without using a mouse! Next, insert the following definitions:

# Alt + Shift move 1/10 page in direction
Key Left        A       MS       Scroll -10 +0
Key Right       A       MS       Scroll +10 +0
Key Up          A       MS       Scroll +0 -10
Key Down        A       MS       Scroll +0 +10

These definitions define Alt+Shift+CursorX, which will shift the current desktop in the designation X direction. This means that you can work using clients whose windows exceed the current desktop borders by shifting the screen! Finally, add what is perhaps the most useful definition:

# Alt + Ctrl move cursor 1/100 page in direction
Key Left        A       CM       CursorMove  -1 +0
Key Right       A       CM       CursorMove  +1 +0
Key Up          A       CM       CursorMove  +0 -1
Key Down        A       CM       CursorMove  +0 +1

These definitions define Alt+Ctrl+CursorX, which will move your mouse pointer 1/100 the width of the current page in the designated direction. This is fine enough resolution to handle nearly every desktop. After making the changes, use fvwm2's root menu (by clicking the left mouse button in a blank area of the desktop) to restart the window manager. This will put your changes into effect right away.

You'll probably also want to define additional keys (such as FKeys) in conjunction with Alt or Ctrl, to mimic mouse button presses or root menu operations. This is a handy way to create a pointerless X11 environment! "Pointers" on creating your own definitions can be found in the fvwm2 man page.

Share ThisShare This

Informit Network