The Window Manager
Because the window manager is an important aspect of X, I need to cover it in more detail. As I mentioned earlier, in most versions of Linux, you will find a couple of
window managers. The fvwm seems to be the most common, although I do see twm quite often.
The following sections describe the basic default behavior of windows, icons, the
icon box, input focus,
and window stacking. The appearance and behavior of the window
manager can be altered by changing the configuration of specific resources.
to control your windows is though accelerator keys (also called hotkeys). By
default, several accelerator keys
perform various functions. Its quite possible that on
your system these bindings have been commenting out of your .fvwmrc file. I'll get to how
to change entries in a moment.
These functions (probably) can be reached through
the window menu as well. It all depends on what is configured in your .fvwmrc file. Any
windows managed by fvwm will have these keys, which are explicitly defined and can be
changed by modifying the appropriate resource (which I'll get to in a moment). These keys
|Alt+F1||Run popup "Utilities"
|Alt+F2||Run popup "Window Ops"
|Alt+F3||Run FvwmWinList Module
|Alt+F4||Iconify the window
|Alt+F5||Move the window
|Alt+F6||Resize the window
|Alt+F7||Circulate window up
|Alt+F8||Circulate window down
|Alt+F9||Iconify the window
The window manager is also responsible for managing
icons. As I mentioned earlier, icons are small graphic representations of clients.
Iconifying (turning into an icon) a client
is a good way to reduce the space taken by
clients that are currently not being used. Although the pager enables you to move clients
from one virtual screen to another, icons are a good way of being able to instantly access
a particular client.
This is done with an "icon box." The icon
box that you will
find on your system is called FvwmIconBox and, in most cases, you will have to configure
the system to start it. (I'll discuss this shortly.)
A nice thing about the icon
is that it represents all running clients, not just those that have been iconified. This
makes finding the client
you want easy, because by double-clicking its icon
in the icon
box, it immediately is made the active window
and is brought to the front.
have a lot of icons, using the icon
box is a good way to manage them. The author of the
FvwmIconBox describes it as a "clutter-reduction program." The icon
simply another client
that manages the icon
images. The icon box can be moved and resized,
even iconified. If there are more icons in the icon
box that can be shown in the box,
scroll bars will appear.
One strong point of both window managers is the ability to
configure them to our tastes. Up to now we have basically been talking about the
appearance of fvwm. What is really fun is to modify its behavior. One way to accomplish
this is through the resource description file, which contains descriptions of resources
that are easily defined in the resource files. The descriptions of resources include such
things as the behavior when buttons are pressed and the individual entries in each
The default resource description file is /etc/X11/fvwm/system.fvwmrc or
/etc/X11/fvwm/system.twmrc. Here again, unless you want to institute systemwide changes, I
recommend that you copy the appropriate file into the users home directory.
This copy then
has the name $HOME/.fvwmrc or $HOME/.twmrc. Here is where your default menus and default
bindings are defined. When you click the root window, the root menu pops up, as defined in
the .fvwmrc or .twmrc file, which is very easy to modify to your personal tastes and preferences.
Three types of resources can be described here: buttons, keys, and
menus. It is said that window manager functions are bound to button or key-press
events. The relationship between the button or key press is called a
Because the resource description file is an ASCII
file, it is easy to edit to make the changes you want. The format of each type of resource is slightly different, but in each case, the fields are separated by white spaces. Any text
unquoted pound sign (#) to the end of the line is considered a comment. Therefore, if any
description must be contained the #, it must be quoted. Single characters can be
"quoted" by escaping them (using the back-slash). Any line containing a !
(exclamation mark) as the first character is also treated as a comment.
event occurs (button or key is pressed or menu item is selected), a particular window
manager function is called. In general, we can say that the functions have the following
You can call dozens of functions that
relate to everything from resizing the particular window or icon
to shuffling the order,
moving, and all the other functions we talked about. All of these are detailed in the fvwm
man-page, so I don't feel the need to cover them all. However, I will discuss some of the
more common functions as I describe the syntax of the resource descriptions.
first thing we'll talk about is the idea of a popup menu. This is not like the menus in
most programs where you see a list of options at the top of the screen and when you click
the list, a menu suddenly appears. These are called pull-down menus because you pull them
down from the menu list. Popup menus seem to popup out of nowhere. With other window
managers, pop-ups are referred to as menus.
You will probably see on your system
that when you click an open area of your desktop with the left mouse
button, a menu called
"Program Menu" will pop up. This menu is defined in your .fvwmrc file. Each
popup menu is defined with the following syntax:
Popup "Popup Name"
functions to call
In the case of
our "Program Menu," the pop-ups name is actually "Applications," so
look for the line
When you find it, you will
see all the same entries that would appear when you click the desktop. When you click one
entry in the list, that particular program or module will start. (A module is a program
used by the window manager and cannot be started in any other way.)
You'll see that
some of the entries have an arrow on the right side. When you click the arrow, it brings
up another popup that is defined somewhere else in the .fvwmrc file. These pop-ups could
then have entries that go to other pop-ups. Although I have tested this to five levels
deep, I have never really had a need to go beyond three levels of popup menus.
start a particular program or module from within the menu, use the Exec function. The
syntax for the Exec definition is
Exec name exec <arguments>
An example would be
Exec "k3b" exec k3b &
The name in each line is
the symbol that will appear in the menu pane for that entry, here, "K3B." Labels containing spaces or tabs must be enclosed within double quotes, as in our example. To start another popup, the syntax would be
Popup "Menu Entry" Popup_Name
Here the "Menu Entry" is just what appears in the menu. The Popup_Name is what it actually will be called.
The title function
within a popup is what appears at the top of the menu when it's started. For example, our
applications popup was called "Applications" and that is how the system referred
to it. However, when we started it, the words "Program Menu" appeared at the
top. This is the title of the menu and has no other function.
If the function called
is the no-operation function (Nop), the function is invalid and/or is the equivalent of
adding a separator in other window manager. If you use just two double quotes ("
") as the name, you will see a line between entries. However, you could include a
line of something like an equal sign (=) to give your menu a different effect.
The accelerator keys syntax is
Key <keyname> <context> <modifiers> <function>
Here <keyname> is the name of a key like F1 for the F1
function key or Tab for the Tab key. The <context> is when this key press should be
valid. Unlike mouse
actions, a key press should be valid in all cases, so you can use an
A. The <modifiers> is used for an addition key that should be pressed as well, such
as "C" for the Ctrl key, "A" for the Alt key, "M" for the
Meta key, and "S" for the Shift key. As I mentioned earlier, your accelerator
keys may have been commented out, so look for the section starting "Keyboard
One example looks like this:
Key F1 A M Popup "Utilities"
Note that in contrast to key presses, key bindings to window
manager functions are just for the key presses. Key releases have no meaning in
this context. Also, the modifiers are exclusive, which means that no other modifier key
can be pressed. Because I specified just Meta+F1 and not SHIFT+Meta+F1, pressing
SHIFT+Meta+F1 would have no effect (unless I had defined it to something already). If you
want, you could use something like "SM" to indicate pressing both the Shift and
Each button binding has the following syntax:
Mouse button context modifier function
The button field defines what button to which this function should
apply (1, 2, 3). The context is when the particular function should be in effect. Valid
|A||A -Any context except for the title bar
|T||Window title bar
|S||Window side, top, or bottom
|F||Window frame (corners)
You can define certain characteristics of the
windows. You can define certain characteristics, such as the foreground and background
color, geometry, etc., when the client is started or by defining that particular resource,
using the Style command within .fvwmrc. In many cases, resources define the same
characteristics. See the fvwm man-page for details.
The syntax of the Style command is
Style <windowname> <options>
The <windowname> can be something other than the windows name, for example, a class
or resource string. The <options> are a common separated list of values. Some options require arguments like
Icon, which requires the name of the icon that you want to use when the window is