Re: Getting and setting window size and position
Jack <[email protected]> Tue, 2 Sep 2025 14:26:02 +0300
| Newsgroups | gmane.comp.xfce.user |
|---|---|
| Message-ID | <CAH8MQ5zFOufMh6kHRcHuCax8ZMBqOuQKoYkHd-=faoa2_hU91g@mail.gmail.com> |
--===============2941182787371318696== Content-Type: multipart/alternative; boundary="0000000000006d10a6063dcfc15f" --0000000000006d10a6063dcfc15f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I require to *Tile* the currently active window into one of the pre-defined positions listed below: 1.The upper left corner 2.The lower left corner 3.The upper right corner 4.The lower right corner 5.The top side 6.The right side 7.The bottom side 8.The left side 9.Full screen The corner windows (1-4) must be 1/2 the width and 1/2 the height of the monitor. The side windows (5,7) must be the full width and 1/2 the height of the monitor. The side windows (6,8) must be 1/2 the width and the full height of the monitor. *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. I intend to test the script by opening four terminal windows and subsequently positioning each one into a different corner. I will then observe if they overlap one another or extend beyond the monitor's boundaries. If this functions correctly, I will proceed the same test with standard application windows for example four browser windows etc. This initially appears to be a straightforward task, but in reality, it is not simple at all. Thank you. On Tue, Sep 2, 2025 at 12:22=E2=80=AFPM killermoehre <[email protected]>= wrote: > Am Dienstag, dem 02.09.2025 um 09:31 +0300 schrieb Jack: > > What is a reliable method to programmatically get and later set the > exact geometry (position and dimensions) of an window under X11 on a Linu= x > Debian XFCE4 system? > > > > I've attempted to use wmctrl, xdotool, and xwininfo without success. Th= e > results are inconsistent, or I am potentially misunderstanding their usag= e. > Could you recommend a more straightforward solution OR clarify how to use > these tools effectively by giving a simple example how to do it? > > Hi, > > you you have some example usage? Because `xdotool` can do what you want, > probably. > > [`devilspie2`](https://www.nongnu.org/devilspie2/) is a deamon doing the > settings on windows create in the background. > > So, what do you want to actually achieve? > > BR > Silvio > _______________________________________________ > Xfce mailing list > [email protected] > https://mail.xfce.org/mailman/listinfo/xfce > http://www.xfce.org > --0000000000006d10a6063dcfc15f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">I require to <b>Tile</b> the currently active window into = one of the pre-defined positions listed below:<br><br>1.The upper left corn= er<br>2.The lower left corner<br>3.The upper right corner<br>4.The lower ri= ght corner<br>5.The top side<br>6.The right side<br>7.The bottom side<br>8.= The left side<br>9.Full screen<br><br>The corner windows (1-4) must be 1/2 = the width and 1/2 the height of the monitor. The side windows (5,7) must be= the full width and 1/2 the height of the monitor. The side windows (6,8) m= ust be 1/2 the width and the full height of the monitor.<br><br><b>The ques= tion is how to obtain the active window's current X,Y,width,height so t= hat I may calculate the new values which are compatible with the utility co= mmand (which one is the best?) which can correctly interpret the values and= position the window to the EXACT (bit-by-bit) location and size?</b><br><b= r>A simple code example (a bash script) that reads the values from the curr= ent active window and then moves the window to one of the corner positions = would be nice to examine.<br><br>I intend to test the script by opening fou= r terminal windows and subsequently positioning each one into a different c= orner. I will then observe if they overlap one another or extend beyond the= monitor's boundaries. If this functions correctly, I will proceed the = same test with standard application windows for example four browser window= s etc.<br><br>This initially appears to be a straightforward task, but in r= eality, it is not simple at all.<br><br>Thank you.</div><br><div class=3D"g= mail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On = Tue, Sep 2, 2025 at 12:22=E2=80=AFPM killermoehre <<a href=3D"mailto:kil= [email protected]">[email protected]</a>> wrote:<br></div><blockquote= class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px so= lid rgb(204,204,204);padding-left:1ex">Am Dienstag, dem 02.09.2025 um 09:31= +0300 schrieb Jack:<br> > What is a reliable method to programmatically get and later set the ex= act geometry (position and dimensions) of an window under X11 on a Linux De= bian XFCE4 system?<br> > <br> > I've attempted to use wmctrl, xdotool, and xwininfo without succes= s. The results are inconsistent, or I am potentially misunderstanding their= usage. Could you recommend a more straightforward solution OR clarify how = to use these tools effectively by giving a simple example how to do it?<br> <br> Hi,<br> <br> you you have some example usage? Because `xdotool` can do what you want, pr= obably.<br> <br> [`devilspie2`](<a href=3D"https://www.nongnu.org/devilspie2/" rel=3D"norefe= rrer" target=3D"_blank">https://www.nongnu.org/devilspie2/</a>) is a deamon= doing the settings on windows create in the background.<br> <br> So, what do you want to actually achieve?<br> <br> BR=C2=A0 <br> Silvio<br> _______________________________________________<br> Xfce mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</a><br> <a href=3D"https://mail.xfce.org/mailman/listinfo/xfce" rel=3D"noreferrer" = target=3D"_blank">https://mail.xfce.org/mailman/listinfo/xfce</a><br> <a href=3D"http://www.xfce.org" rel=3D"noreferrer" target=3D"_blank">http:/= /www.xfce.org</a><br> </blockquote></div> --0000000000006d10a6063dcfc15f-- --===============2941182787371318696== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xfce mailing list [email protected] https://mail.xfce.org/mailman/listinfo/xfce http://www.xfce.org --===============2941182787371318696==--