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.

  • 1
    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 'SO- stop being evil' Jan 27 '12 at 23:21

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.

| 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:

To this edited date, Cream Desktop Environment has no activity since 19 Jan 2014, according to the project site on GitHub. The main website is down since mid-2013, according to Internet Archive Wayback Machine but available as last good capture dated 28 Jan 2013.

| 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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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