The utility wmctrl (install it with sudo apt-get install wmctrl) can interact with the window manager. You can list open windows with:
wmctrl -l
You can supply the window geometry with:
wmctrl -G -l