Welcome to
PyWM logo PyWM

your Python Window Manager


Kindly hosted by Sourceforge

Intro | Features | Screenshots | Purpose | Python APIRequirements | Status | Download

Return to
David's Python Archive

What's PYWM?

PYWM is a small, simple python-programmable X window manager that's packed with features yet very easy to learn and use.

Some window managers are mouse heaven and keyboard hell. Other window managers are the other way around.
But PYWM aims to be very comfortable to use from either.

PYWM is a "pythonised" version of the fast light FLWM window manager, and gives you easy-to-use tools to create your own personal dream desktop. Control Freak Heaven.


So What Can I Do With It?

All sorts of stuff, limited only by your imagination. Here's a short (and very incomplete) list:

Why???

I've seen dozens of window managers in my time.

At one extreme are the morbidly obese KDE and Gnome desktops, which can take longer to fire up than Linux itself! One wonders if development of these two projects is funded by manufacturers of memory and hard disks :p

At the other extreme are hard-core 'minimalist' window managers like 'LWM' and 'TWM', which can be very functionality-challenged, or have some annoying quirks. For example, one WM I tried requires you to hold down the ALT key while using the mouse within a window!

On the fringes are 'rodentophobic' window managers like Matchbox, RatPoison, Ion etc. One thinks of certain people (who will go nameless) who take pride in still using ASCII dumb terminals.

On the advanced end of the spectrum is the wonderful LISP-driven 'Sawfish' window manager.

But PyWM is aimed at the middle ground. On one hand, it's easy to set up magickal key bindings to do pretty much what you want. But on the other hand, it's also comfortable and courteous for mouse users. I find myself often switching from mouse/keyboard to straight keyboard, so PyWM is there for me all the way.

And, above all, it's built to support easy customisation in Python, the world's coolest programming language.


What's the Python Scenario?

I've taken the FLWM window manager and wrapped it into a Python module as a 'window manager engine'.

You drive PYWM by creating a subclass of the basic pywm.WM window manager class. If you want even more per-window control, you can subclass the pywm.window class as well. Plenty of examples in the PYWM distribution you can use as a starting point.

If you like, why not browse the documentation online?

Within your derived classes, you write event handlers, which receive all kinds of window manager related events, and within the event handler methods, can pick from a large range of actions.

The PyWM API is kept clean, simple and intuitive. So you won't be dragging your ass through unreadable source code and incomplete/inaccurate documentation for hours just to figure out how to do basic stuff. There are some programmers who get a perverse rush from making their APIs as complicated and obscure as possible. For example, in raw X, it takes 12 args to a function to get just the title of a window! But that's not how I work...

Within your handlers, you can:
Your handlers can receive events, such as:
In contrast to other Python-driven window managers, this one is so easy and intuitive that you'll be hacking your own window manager script in a couple of minutes. A set of easily-undersood example scripts is included with the distribution.

Caveat - due to some quirks in Pyrex, some exceptions may not appear on stdout - if things ever look weird, just sprinkle in a few print statements while debugging, until you figure out what's happening.

Also, while you're testing/debugging your Python script, you're best advised to put 'xterm' in your .xinitrc, and launch your script manually within the xterm window.

What Do I Need?

Requirements:
Note - if your system has glibc 2.2 or later, and Python 2.2.1 or later,
you can save yourself the need to download/install/compile FLTK 1.0 and Pyrex,
and use the precompiled binary
flwm_.so module in the tarball.


Where's It At?

PyWM is in a prototype state, but it's working well enough to offer for download and review.

Be warned that if your scripting has errors, it can take the X server down with it, killing off your apps and causing possible loss of data.

There may also be bugs in the FLWM core, or in the PyWM code, which cause stability problems as well.

So if you want to play around with PyWM, please observe the following:

I'm Curious - Gimme a Copy!

Download PYWM here


Intro | Features | Purpose | Python APIRequirements | Status | Download

Page updated June 2, 2003 by David McNab
Privacy Policy