Getting and setting window size and position

Ralf Mardorf ralf.mardorf at alice-dsl.net
Tue Sep 2 21:24:13 CEST 2025


On Tue, 2025-09-02 at 14:26 +0300, Jack wrote:
> The question is how to obtain the active window's current
> X,Y,width,height so that I may calculate the new values which are
> compatible with the utility command (which one is the best?) which can
> correctly interpret the values and position the window to the EXACT
> (bit-by-bit) location and size?
> 
> A simple code example (a bash script) that reads the values from the
> current active window and then moves the window to one of the corner
> positions would be nice to examine.

To do this you only need to know what windows is the active window. The
current position and size of the active window are irrelevant.

Open program 1

xdotool getactivewindow

Set the desired position and size of this window (it's just a little
tricky as the "real" position may be off by a few pixels, possibly a GPU
issue or related to some panel foo).

&& open program 2

[...]

&& open program 3

[...]

&& open program 4

[...]


More information about the Xfce mailing list