Using other window managers on the SGIs

What is a window window manager?

The window manager is the program that runs under X that is responsible for placing all other windows on the screen. Window managers also decide which window gets keyboard and mouse activity as well as which parts of overlapping windows are visible. It may decorate the window with borders and title bars, which in turn may (or may not) have buttons that allow you to move, resize or iconify the window. Multiple desktops and showing icons for windows that are minimized are also the responsibility of window managers having these features.

Why change window managers?

SGI's window manager, 4Dwm, is big and slow. Both fvwm2 and ctwm enable you to have multiple desktops while using a lot fewer system resources. Running ctwm with 6 desks requires a little over 4.5 megs of memory, fvwm2 with 9 takes a bit less than 5.5 megs, and 4Dwm with 4 desks needs over 13 megs. Several people who have switched from 4Dwm to one of the others have noticed that just about everthing that involves manipulating a window (moving, re-drawing, etc.) seems much faster under both of the other two window managers.

The other two window managers also have some other benefits. The essential parts of the desktop (desk overview and window list) take up much less space than the desk overview and icons in 4Dwm. They also allow you to do things like windowshade a window (roll up the window so that all that is visible is the title bar), and are more easily customized than 4Dwm.

Setting up your account

  1. cd to your home directory.
  2. Execute the command
    "tar xvf /usr/groupS/lib/new_user/fvwm2-user.tar"
    or
    "tar xvf /usr/groupS/lib/new_user/ctwm-user.tar". This will create a file called .xsession as well as the necessary initialization files for fvwm2 or ctwm.
  3. Edit .xsession to suit your needs. This file contains the commands that will be used to set up your Xwindows session each time you login to the machine from the login window (but not for each terminal window). Each of the lines will be executed in the order that they appear in the file. All of the lines except the one invoking the window manager should end in an "&". The window manager should be the last command in the file.
  4. Log out and log back in again. If you can't log in, login as username failsafe where username is your login name. From the window that comes up change the line that says fvwm2 or ctwm to have the full path to the window manager. Log out and log back in again.

Customizing the window manager

The definitive place to look for how to change things is in the man page for fvwm2 and ctwm, but below are a few simple things that can be done to tweak the default settings provided in the .tar files.

fvwm2

Although it has nothing to do with customizing, there is one nice feature of fvwm2 that should be mentioned. Clicking and dragging on a window with the middle mouse button in the desktop manager will actually move the window.

There are two places to customize fvwm2, the .fvwm2rc file and the .fvwm2 directory, both of which are located off your home directory. The .fvwm2 directory contains a file called main-menu.hook that controls the menu that is displayed when the left mouse button is clicked over top of the desktop (root window).

The .fvwm2rc file contains the general settings for fvwm2. Included in this are things like how many desktops there should be, where the desktop box should go, how to handle windows that are minimized, etc. Also included are what actions are associated with mouse clicks on different parts of the window and hotkeys that could be assigned to do various things like iconifying a window or moving it to a different desktop.

One simple example of customizing fvwm2 is setting it up so that clicking the right mouse button on the title bar of a window will cause the window to roll up (windowshade). To do this, go to the line in .fvwm2rc that reads
Mouse 0 T A move-and-raise-or-raiselower
and change it to
Mouse 1 T A move-and-raise-or-raiselower
Mouse 2 T A move-and-raise-or-raiselower
Mouse 3 T A WindowShade
The original line meant "when clicking on the title bar with any mouse button, raise the window to the top unless it is already on top, in which case send it to the bottom." The three new lines keep the same meaning for the left and middle button, but now the right mouse button will cause the window to windowshade. After saving the changes, click the left mouse button on the root window, then choose Exit Fvwm --> Restart Fvwm. That's all there is to it.

ctwm

Unlike fvwm2, ctwm only has one place to place customizations, the .ctwmrc file in your home directory. It contains everything about how ctwm manages the desktop.

As in the fvwm2 example, the example of customization will be to make the right mouse button windowshade ("squeeze" in ctwm terms) the window when it is clicked on the title bar. To do this, open .ctwmrc in a text editor. Near the bottom of the file there is a line that reads
Button1 = s c : title : f.squeeze
change it to
Button3 = : title : f.squeeze
The original line said "squeeze the wi ndow if the left mouse button is clicked on the title bar while either the shift or control key is pressed." The new line says to squeeze the window when the right mouse is clicked on the title bar. Squeezing a window that has already been squeezed will un-squeeze it. Restart ctwm by clicking the right mouse button on the root window then choosing CTWM Ops --> Restart.