How can I move/resize a window using python-xlib?
Asked Answered
L

1

7

How can I resize/move a window using python-xlib? I have the X window ID. What's the equivalent python-xlib snippet to wmctrl -i -r $id -e $gravity,$x,$y,$width,$height?

Lillylillywhite answered 20/6, 2012 at 19:40 Comment(0)
E
4

You need ConfigureWindow request to change x,y,width,height and ChangeWindowAttributes request to change gravity. You can use them directly or with resource/window wrapper

win = xobject.drawable.Window(display, id)
win.configure(x=123, y=345, width=678, height=910)
win.change_attributes(win_gravity=X.NorthWestGravity, bit_gravity=X.StaticGravity)
Euphroe answered 22/6, 2012 at 1:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.