1

I want to implement a simple specialized window manager for presentations (not user-controllable) that supports only the following operations:

  1. Moving and resizing of windows
  2. Switching desktops
  3. Starting applications not on current desktop (in background) without disrupting current image.

I don't need any user input, button/titles, ...

What existing window manager should I use as example? There are many little "hello world" window managers, but they usually does not support desktop switching.

Vi.
  • 37,014
  • 18
  • 93
  • 148

2 Answers2

3

You don't need to reimplement the wheel.

  • openbox will do everything you mention and more besides.

    Simply edit the rc.xml to disable the root menu, and re-launch.

    Openbox also allows per app setting so that certain applications can open on a particular desktop by default, or with a particular size, or open hidden.

    It also supports wildcards in the window selection, so that settings can apply to all windows.

  • devilspie2 is a window matching utility that can perform actions whenever a window opens.

    It is highly hackable and the code is available on github. It will match windows by name/class/etc when they open, and perform actions on them. (including matching all windows and moving them to a different desktop. It will work with most window managers.

    Based on the original devilspie which does not have Lua scripting, but is configured using s-exprs instead.

  • xdotool will also allow you to perform complex actions on windows without hacking any code. It will even fake user input (mouse/kbd) if you need it.

brice
  • 24,329
  • 7
  • 79
  • 95
  • OK, will try openbox. The main point is controlling on what desktop to show new windows (not by window class/name). Started applications must prepare their things in background. – Vi. Mar 30 '12 at 14:47
  • Openbox allows, in the `rc.xml` file, to open windows on a particular desktop based on their X properties. – brice Mar 30 '12 at 14:48
  • I need it to open _all_ windows on desktop N. Then to switch to desktop N and open _all_ new windows on desktop M. May be I'll end up using patched openbox (or awesome or other not bloated WM). – Vi. Mar 30 '12 at 14:50
  • See update. There's also a standalone utility that does exactly what you ask, but the name escapes me. – brice Mar 30 '12 at 14:53
  • The utility is called devilspie – brice Mar 30 '12 at 15:23
  • Will moving a window away using devilspie2 work seamless, e.g. without chance of "flashing" it on current desktop? Like if I suspend devilspie2 new clients will wait without mapping their windows until I resume devilspie2. – Vi. Mar 30 '12 at 22:05
  • openbox open-on will definitely work without flashing. IIRC, so does devilspie. Have never tested what you're trying to do, so can't tell you. You'll have to try it :) – brice Mar 30 '12 at 23:17
1

There are a few window managers written in Python that could be good starting points. Qtile and whimsy both describe themselves as hackable.

jtg
  • 386
  • 1
  • 5