Created
August 23, 2017 00:08
-
-
Save chipolux/13963019c6ca4a2fed348a36c17e1277 to your computer and use it in GitHub Desktop.
Moving X11 Window (python-xlib)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Xlib.display | |
WINDOW_NAME = 'some window name' | |
d = Xlib.display.Display() | |
r = d.screen().root | |
x = 0 | |
y = 100 | |
width = r.get_geometry().width | |
height = r.get_geometry().height - y | |
window_ids = r.get_full_property( | |
d.intern_atom('_NET_CLIENT_LIST'), Xlib.X.AnyPropertyType | |
).value | |
for window_id in window_ids: | |
window = d.create_resource_object('window', window_id) | |
if window.get_wm_name() == WINDOW_NAME: | |
print('Moving Window') | |
window.configure( | |
x=x, | |
y=y, | |
width=width, | |
height=height, | |
border_width=0, | |
stack_mode=Xlib.X.Above | |
) | |
d.sync() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment