Open Source

Introducing the Sawfish window manager

There's a new kid on the block when it comes to window managers for Linux. In this Daily Drill Down, Vincent Danen introduces you to the Sawfish extensible window manager.

There's a new kid on the block when it comes to window managers for Linux, and its name is Sawfish. Sawfish resembles other window managers in function, but in this Daily Drill Down, I’ll examine a number of differences so that you can determine whether Sawfish is for you.

As of this writing, the current version of Sawfish, 0.24, is available from sourceforge. The author of Sawfish, John Harper, designed Sawfish to be an extensible window manager using his own LISP (List Processing)-based scripting language called librep. Because of this, all window decorations are configurable, and the user-interface policy is controllable through the extension language. The aim of Sawfish is simply to manage windows in the most flexible, efficient, and attractive manner possible.
The Sawmill window manager has undergone a name change due to collision with another HTML logging application. Although the name in this Daily Drill Down has been changed from Sawmill to Sawfish, the version described deals with directories and files that were titled Sawmill. If you’re using a version earlier than 0.27-1, the name will, in fact, be Sawmill.
Extensible what?
What I mean by extensible is that Sawfish, through librep, allows you to configure various aspects of how Sawfish looks and works. Through configuration files and the configuration tool, you can configure how Sawfish looks in pretty much every way. You can also specify how the key bindings and mouse clicks are defined on windows and parts of the screen. Sawfish lets you define application groups for window styles and key bindings, allowing you to differentiate between, for example, Internet applications and office applications. If you know how to write scripts in LISP, you can extend the functionality of Sawfish quite dramatically.

In terms of included "extras," Sawfish might seem very minimalist compared with other window managers, such as Enlightenment or WindowMaker. However, this is a small drawback considering that Sawfish interoperates with GNOME (GNU Object Modeling Environment) seamlessly. One nice feature is when you define the number of virtual workspaces you want to use in X-Windows, the GNOME pager automatically reflects the changes based on the Sawfish configuration.

Another example of how Sawfish integrates nicely with GNOME is that a number of its configuration options are available from the GNOME Control Center. You don’t need to launch the Sawfish Configurator tool to configure some aspects of Sawfish—you can do so directly from your GNOME configuration utility.

Although Sawfish can be used as a stand-alone window manager, it can also run GNOME and KDE (K Desktop Environment) applications without requiring the entire desktop manager to be running beneath it. In addition, Sawfish generates a menu system based on the current user's GNOME menu system. This Sawfish-generated menu system provides access to the KDE menus as well, allowing you to access all your favorite GNOME and KDE programs easily.

The end result of not requiring an underlying desktop manager is that Sawfish uses very little overhead and leaves a very small memory footprint. It also makes Sawfish one of the fastest window managers available in its class. What I mean by class is the base function available via the window manager. For example, Sawfish, Enlightenment, and WindowMaker all have a number of similar functions, ranging from configuration tools, roll-up title bars, themes, and so forth. Other window managers, like Ice WM or twm, don’t include a number of these functions and are in a class of their own. (I call them the minimalist window managers.)

For those of you who absolutely must have numbers and comparisons, I ran a little test on my PII-350-MHz computer, which has 192 MB of RAM and was running GNOME at the time of the test. I had two Eterm windows open, gkrellm running, and Netscape sitting on my home page. I then loaded X-Chat and watched for the peak CPU and memory monitors for each window manager. Here are the results:
  • Sawfish: 0.9% CPU, 1.3% MEM
  • Enlightenment: 1.9% CPU, 2.5% MEM
  • WindowMaker: 1.5% CPU, 1.7% MEM
  • Ice WM: 0.1% CPU, 1.7% MEM
  • twm: 0.1% CPU, 0.8% MEM

The least resource-hungry window managers were Ice WM and twm, but these are both minimalist window managers, and I used them more for comparison than anything else. The results were encouraging. Enlightenment was the obvious resource-hungry window manager of the bunch. Sawfish and WindowMaker came out somewhat close in terms of both CPU and memory usage, with Sawfish being the lighter of the two.

The next comparison I performed was with the window managers running stand-alone without GNOME running beneath, using the same test conditions. Again, I used the peak CPU and memory usage when loading X-Chat after the other applications were already opened and idling. Here are the results:
  • Sawfish: 1.1% CPU, 1.3% MEM
  • Enlightenment: 2.9% CPU, 2.5% MEM
  • WindowMaker: 1.5% CPU, 1.7% MEM
  • IceWM: 0.1% CPU, 1.5% MEM
  • BlackBox: 2.3% CPU, 1.1% MEM
  • AfterStep: 0.7% CPU, 0.8% MEM

As you can see, Sawfish isn't the most efficient window manager when compared to some others under the same test conditions. However, it does perform quite admirably and is definitely one of the faster ones.

The Sawfish Configurator is a very nice configuration utility that comes with Sawfish. It allows you to configure a host of options to make Sawfish more suited to your needs. Like any good window manager, Sawfish supports themes that you can download (go to ). This makes the appearance of Sawfish completely customizable. All of the key bindings are customizable for a number of areas, ranging from the root window (the actual desktop space) to the different buttons on the title bar. Windows can be “iconified,” and you can define Sawfish's behavior in that respect. You can also configure how Sawfish handles window movement and placement. You can define the number of workspaces and how they interact with each other. Unfortunately, Sawfish doesn’t come with its own pager, so you need to rely on the GNOME panel pager applet to have a visualization of the different workspaces.

Outside the Sawfish Configurator, more user customization is available using the ~/.sawmillrc file. This file, which resides in the user's home directory, should contain LISP code that changes the behavior of Sawfish. In this file, you can change key bindings and colors—virtually anything that can be changed within the Sawfish Configurator, as well as some things that can't. If this file doesn't exist, Sawfish uses the default sawmill-defaults LISP library, which can be found in /usr/share/sawmill/lisp/sawmill-defaults.jl. Options defined using the Sawfish Configurator are saved in the ~/.sawmill/config file, so the configuration can be customized and saved across sessions.

If you’re interested in some user-supplied hacks and other customizations, visit the Sawfish LISP Repository at the Sawmill customization repository . This site offers very interesting and useful bits of LISP code that can be easily inserted into your ~/.sawmillrc file to make Sawfish run that much better.

These days, window manager themes are becoming extremely popular, and many people are putting some very nice work into making their own themes for their favorite window manager. With Sawfish, this is no different. The theme repository at is a prime example, with more themes making their way onto the site all the time. Sawfish makes it easy to create new themes, unlike some other window managers. Sawfish comes with its own theme-creation utility, aptly called the Sawfish Theme Builder. The Sawfish Theme Builder is a small program that will allow you to customize a whole host of features for your theme, from frames to how the top bar looks when it's in or out of focus. And if you want something to integrate with the GIMP (GNU Image Manipulation Program) when you're designing your new theme, take a look at the GimpMill program . This plug-in, written in Python, lets you construct Sawfish themes by extending the GIMP interface to allow theme creation.

Installing new themes in Sawfish is quite simple. If you have root capabilities on your computer, you can grab any theme you like (for example, AquaOS.tar.gz) and copy it into the /usr/share/sawmill/themes/ directory:
cp AquaOS.tar.gz /usr/share/sawmill/themes/

If you don’t have root capabilities, you can copy it into your ~/.sawmill/themes/ directory instead:
cp AquaOS.tar.gz ~/.sawmill/themes/

Then, run the Sawfish Configurator and select your new theme and load it. You can even untar the files if you prefer, instead of keeping the archives in either directory, but leaving them archived uses less space.

Now that you know some of what Sawfish is capable of, you might be interested in installing it. Sawfish requires some extra libraries written by the author, such as librep and rep-gtk, for GTK+ support. These are all available from the Sawfish home page and must be installed before Sawfish is installed. You’ll also need to have the Imlib library installed. Getting it installed shouldn't pose too much of a problem because the Enlightenment window manager requires it as well. Because Sawfish is so new, there aren't very many RPM archives available, although there are RPMs for Red Hat, Linux Mandrake, and LinuxPPC. In fact, the new LinuxPPC 2000, which was unveiled on February 14, 2000, uses Sawfish as the default window manager as opposed to any of the older and more mature window managers.

There are also .deb packages available for Debian. If you’re using one of these distributions, installation is easy. If you aren't, you'll need to grab the tarballs for Sawfish, librep, and rep-gtk. You must install librep and then rep-gtk before you install Sawfish because Sawfish depends on the libraries to compile. There were rumors that the author was going to change from librep to Guile in the future, making the need for these libraries obsolete. However, it doesn't look as though that will be happening any time soon, so these libraries are required at the time of this writing.

Unarchive the tarballs into your /usr/src/ directory like this:
tar xvzf sawmill-0.24.tar.gz
tar xvzf librep-0.10.tar.gz
tar xvzf rep-gtk-0.8.tar.gz

You’ll then need to enter each subdirectory to compile and install the libraries and programs for Sawfish. Start with the /usr/src/librep-0.10/ directory and issue:
make install

Now run the same commands in the /usr/src/rep-gtk-0.8/ directory and finally in the /usr/src/sawmill-0.24/ directory. Once you’ve compiled and installed everything, you should have a working Sawfish installation.

The librep shared library implements a LISP dialect that’s lightweight and fast. It’s also highly extensible and contains an interpreter, a byte-code compiler, and a virtual machine. Applications such as Sawfish can use the interpreter as an extension language for their own programs or for stand-alone scripts. Because of this, librep can be used for more than just Sawfish.

The rep-gtk library is a binding of the GTK and GDK libraries for the librep LISP environment. The current version of rep-gtk, 0.8, is targeted at GTK version 1.2 and was originally based on the guile-gtk binding by Marius Vollmer. This library allows librep programs and scripts to interact more completely with the GTK environment, which is used by GNOME.

Sawfish is currently in very active development (three separate releases and one bug-fix release in the month of January alone). Some of the items the author will be addressing in future versions, aside from bug fixes, are adding color-map handling and other "eye candy" to make Sawfish look even nicer. You'll also be able to name workspaces as you currently can with other window managers such as WindowMaker. The theme support will be enhanced to better support GTK themes (the themes GNOME uses), which will give users far more options when it comes to customizing how Sawfish looks.

The Sawfish Configurator will also be getting some more work to make it even more useful in customizing your system. It will have more options, and the interface will be cleaned up a bit to make it easier to use. You’ll soon be able to define a program list, which will allow you to launch applications using a hot-key instead of relying on a pop-up or desktop menu.

The default window manager?
Having said all of this, I really recommend you take a look at Sawfish. It’s quite a powerful window manager and will give the other more popular window managers a run for their money soon. With the rapid development of Sawfish, updates and bug fixes are more frequently available, which is nice with such an immature program. The integration with GNOME is a definite asset and ranks up there with some of Sawfish's other more powerful features. Although the base of third-party Sawfish programs and extensions is currently slim, with the quick acceptance of Sawfish, this will probably change in the near future.

The GNOME desktop typically comes with Enlightenment as the default window manager. Enlightenment is an excellent window manager. But let's face it: With each new release, Enlightenment becomes bigger, slower, and packed with more features that rival GNOME's own feature base. Enlightenment is swiftly becoming a stand-alone window manager in its own right, and even now it can be run independently of GNOME with a number of features and applets (or rather "epplets") that rival those of WindowMaker. A lot of people feel that Enlightenment is a bit of overkill for being the default GNOME window manager, and they are probably right. I think that the direction Enlightenment is taking is to become a window manager completely independent of GNOME, which is both a good and bad thing. It's good because Enlightenment is a very powerful and robust window manager, and it's bad because it makes using it with GNOME a bit of an ordeal. People like their X sessions to be fast, and using both GNOME and Enlightenment, this speed is only possible with higher-scale hardware.

Will Sawfish become the new default GNOME window manager? It's difficult to say. A number of window managers provide GNOME support beyond just Enlightenment. WindowMaker and Ice WM both provide good GNOME support, so perhaps they’ll become the default window manager once Enlightenment has progressed to the point where running it simultaneously with GNOME is no longer feasible. Personally, I hope that Sawfish takes the role of the default GNOME window manager in the near future. Because of its speed and extensibility, not to mention its seamless integration with GNOME, it’s the perfect choice.

Vincent Danen, a native Canadian in Edmonton, Alberta, has been computing since the age of 10, and hehas been using Linux for nearly two years. Prior to that, he used OS/2 exclusively for approximately four years. Vincent is a firm believer in the philosophy behind the Linux "revolution,” and heattempts to contribute to the Linux causein as many ways as possible—from his FreezerBurn Web site to building and submitting custom RPMs for the Linux Mandrake project. Vincent has also obtained his Linux Administrator certification from Brainbench .He hopes to tackle the RHCE once it can be taken in Canada.

The authors and editors have taken care in preparation of the content contained herein, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for any damages. Always have a verified backup before making any changes.

About Vincent Danen

Vincent Danen works on the Red Hat Security Response Team and lives in Canada. He has been writing about and developing on Linux for over 10 years and is a veteran Mac user.

Editor's Picks

Free Newsletters, In your Inbox