X11: move an existing window via command line?

I think xdotool will do the job.

xdotool lets you programatically (or manually) simulate keyboard input and mouse activity, move and resize windows, etc. It does this using X11’s XTEST extension and other Xlib functions.

E.g.

$ xdotool windowfocus 0x1a00ad2

will focus the window with id 0x1a00ad2. There’s also a windowmove command which is probably the one you’re looking for.

wmctrl is slighty more advanced. It is compatible with EWMH/NetWM X window managers as you can read on their website. I don’t think you’ll need it to be compatible with those though.

Leave a Comment