I'm using FVWM2, which allows me to send the current X11 WindowID to any script I like through window decoration bindings.
So a click might execute a CLI program in the following form:
bash# example.pl
In this case WindowID refers to an already existing window. Not one that is generated by example.pl.
If example.pl a a screen capture utility for example, it will need the X11 geometry string of the window identified by , to run the capture. I can parse this data from xwininfo output. But that is not portable.
How do I get the X11 geometry from a WindowID, programatically, in Perl?
You can use
X11::GuiTestto get various pieces of information about the X11 window.In your case, the appropriate command would be
GetWindowPos(windowID):$widthand$heightare the dimensions of the window,$borderWidthis the border on it, and$screenis the screen that it is on.