Getting and setting window size and position

Ralf Mardorf ralf.mardorf at alice-dsl.net
Tue Sep 2 20:03:07 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?

The second script from my first reply (named "wing") does this:

   #!/bin/dash
   xdotool getwindowgeometry --shell $(xdotool getactivewindow) | zenity --text-info
   exit

You need to make the dash script executable. You probably need to
install https://tracker.debian.org/pkg/zenity or to replace it by
something else.

You need to assign the script to a shortcut or by the menu, when not
using fbpanel you need to provide a wing.desktop file to add it to the
menu. If you would run it from a terminal, the terminal would be the
active window.


More information about the Xfce mailing list