[Metalab] howto control windows position and size?

Ralf Schlatterbeck ralf at zoo.priv.at
Tue Jan 15 08:38:18 CET 2008


On Sat, Jan 12, 2008 at 12:10:59AM +0100, Clifford Wolf wrote:
> 
> technically it should also be possible to move and resize any x11 window by
> interacting with the window manager - however, i don't know the apis to do
> this with any of the window managers i know..

There ist the wnck lib, which also has python bindings with this you can
do:

#!/usr/bin/python
import wnck

scr = wnck.screen_get_default ()
scr.force_update ()

scr.get_windows ()[4].get_name ()
scr.get_windows ()[4].minimize ()

There are some methods that take a timestamp which only work if the
timestamp is "correct". I've not yet found out (and the docs aren't
clear on this) what constitutes a valid timestamp. I've not managed to
un-minimize a window (without resorting to brute-force testing of
possible timestamps).
The code above is tested for the metacity window manager.

Ralf
-- 
Ralf Schlatterbeck
email: ralf at zoo.priv.at FAX: +43/2243/26465/23




More information about the Metalab mailing list