lwm - Lightweight Window Manager

Introduction

lwm is a window manager for X11 that tries to keep out of your face. There are no icons, no button bars, no icon docks, no root menus, no nothing: if you want all that, then other programs can provide it. There's no configurability either: if you want that, you want a different window manager; one that helps your operating system in its evil conquest of your disc space and its annexation of your physical memory.

That paragraph has probably told you whether or not you're the sort of person who can cope with lwm. Be warned: there are two useful things that lwm cannot do. It cannot cope with multi-headed machines (i.e. it can only manage windows on one screen of a display) and it does not offer a virtual desktop. If anyone wants to lend me a really nice machine with multiple screens, then I'll look in to the first problem! If I ever find myself stuck with a 640 by 480 screen, I'll look in to the second. Or give up X11. It strikes me that the sort of people who like lwm really shouldn't be using a windowing system as tasteless yet flavoursome as X11. Maybe we should look at the windowing system next.

User Guide

Input focus

lwm allocates input focus using a lazy focus-follows-mouse system. That's to say: if the mouse is not over the root window then the window in which it finds itself has input focus.

lwm decorations are exceedingly simple. Most windows visible will have a white border a few pixels thick all the way around. Only the window with input focus has a title bar, and then only if it has set a window title (so xclock would not normally have a title bar).

The window with input focus (for pointer events) has a black border rather than a white border. The last window that the pointer entered that accepted input will have the input focus for keyboard events. This distinction may be made by a filled text cursor (as with xterm). Usually, the window with a visible title and black border has input focus for all events.

Window manipulation

A button 1 click on a window frame brings that window to the top. Dragging button 1 on the frame of a resizable window repositions that edge of the window. If a corner rather than an edge is dragged, then both edges forming the corner are repositioned.

In the default configuration, button 1 on the root window does nothing.

Button 2 is used to drag a window by its frame, repositioning the window but maintaining its position in the window stack.

In the default configuration, button 2 on the root window brings up a new shell.

A button 3 click on a window frame makes that window disappear. Don't worry because...

Pressing button 3 on the root window brings up a menu. The various items unhide the named hidden window.

The little white box in a window's frame can be used to close the window. Clicking once politely shuts down the application. If you feel you're being ignored, click again to violently terminate the application's connection.

Configuration via X resources

I lied when I said that you can't configure lwm. The sort of people who judge a program by the number of switches and resources it has won't be satisfied, but lwm does in fact recognise the following X resources:

Bugs

There are bugs, there are things that haven't been gotten round to yet, and there are things that you won't like that are there on purpose. If you don't see your complaint in the list below, it might be worth your while mailing me. Bug fixes and improvements are just as gratefully received.

List of infelicities and suggested improvements

The following is a list of the problems with lwm of which I'm aware. Being on this list is no real guarantee of anything. If something is troubling you greatly, you should mail me to spur me to do something more than simply acknowledge the existance of the problem!

Acknowledgements

This program's philosophy is based on no particular window manager, but inspiration has come from numerous sources. The general window hiding was first seen in Rob Pike's 8.5 windowing system for Plan 9. The use of the right-hand button for hiding (rather than a menu of window operations as seen in 8.5) came from experience of John Bradley's xv. The disappearing title-bars came about from a misunderstanding of BeOS' method of iconizing windows. The automatic window placement heuristics are simple but effective. It would be nice to have a window manager that does more window management for us.

The code is at heart a gradual rewrite of 9wm by David Hogan (dhog@cs.su.oz.au) and the real thanks must go to him. It was seeing 9wm that made me think that writing a window manager wasn't such a ridiculous idea. I'd already written a window manager similar to lwm for Plan 9, based on 8.5 - it seemed sensible to start the X11 version from a window manager with a similar outlook.

I'd long thought about writing a window manager, but seeing the size of twm (and even uwm is larger than both 9wm and lwm) put me off. 9wm showed that a useful window manager doesn't need to be huge in either source or binary.

The O'Reilly books Xlib Programming Manual and X Protocol Reference Manual (volumes one and zero respectively in their series of books on the X Window System) were invaluable to me while writing lwm. Thanks to Adrian Nye for his brave effort to make sense of the nonsensical.

The following were brave enough to use lwm very early on, and proved a great source of encouragement and ideas: James Carter, Mawuli Lodoh, Stephen Parker, and Marcel Ward.

Downloading

lwm is free and available for download. It's a 30 KByte tar.Z file.

Author

Elliott Hughes (enh@genedata.com)