Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been coding bits here and there with Python and I'm most interested in Desktop Environments, for which I always have ideas I want to try out.

I have tried to play around with python-xlib but there is too little documentation on how to use this, and the ICCCM doc is very obscure. So I haven't been able to go very far.

More over I am not so much interested in making a window manager as I am interested in making applications for the desktop environment that interact with it. e.g. a task-bar. Talking to X directly then, means bypassing the WM.

So I'd like to know whether there is any of the major WM out there that have python bindings, so I could interact with them. I've found python-metacity and python-compizsettings but I've found zero documentation out there on how to use them.

The overall picture is a bit depressing from the Python viewpoint. If you have any suggestions, please let me know.

share|improve this question
If what you're after is a window manager that's written in a high-level language and easily extended in that language, I think the current serious offerings are Awesome (Lua), Sawfish (Scheme) and Xmonad (Haskell). Nothing like these for Python. – Gilles Jan 27 '12 at 23:21
up vote 5 down vote accepted

They are not "major" window managers, but there are three window managers that are python-based:

  • qtile, a hackable tiling window manager written in Python.
  • PyWM, a "pythonised" version of the fast light FLWM window manager.
  • whimsy, a small (~1000 SLOC), highly hackable window manager written in Python.

There is another one, samurai-x that is described as a "work in progress."

You could also take a look at stiler, a simple python script which does tiling on any window manager and PyWo which does the same thing on EWMH compliant window managers.

share|improve this answer
Cheers. Would you know anything about the python bindings for metacity and / or compiz too? – Benjamin Jan 27 '12 at 9:43
Sorry, no: I'm not familiar with either... – jasonwryan Jan 27 '12 at 18:14

Two others that weren't mentioned:

share|improve this answer

pyxfce offered Python bindings to XFCE. Unfortunately, it is no longer maintained since 2009.

I agree that Python bindings for popular desktop environments is something that is missed by many potential desktop application developers. However, this should not impede you from going ahead and developing something in Python whilst taking advantage of freedesktop.org specifications.

Finally, it may be possible to integrate your Python application by adding some C boilerplate code. For example, the XFCE wiki explains how to create panel plugins. Desktop developers may be willing to help you out if you ask them.

Also, you might have more luck finding Python bindings for both the Cinnamon and Mate desktop environments. The Linux Mint team develops its custom applications mainly in Python.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.