Re: Getting and setting window size and position
Jack <[email protected]> Wed, 3 Sep 2025 10:20:21 +0300
| Newsgroups | gmane.comp.xfce.user |
|---|---|
| Message-ID | <CAH8MQ5zbqK-kHAVx6-79bokXKOFbKboaeq324D=P27OMgBArkg@mail.gmail.com> |
--===============9074417648574204796== Content-Type: multipart/alternative; boundary="000000000000ae7aaa063de070e5" --000000000000ae7aaa063de070e5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable btw. This also applies to the location. On Wed, Sep 3, 2025 at 10:17=E2=80=AFAM Jack <[email protected]> wrote: > Unfortunately, *built-in commands cannot be used* because after using > them, the window size can no longer be changed programmatically (ie. from > the scripts). This is because if you switch to another desktop and then > return, the window manager no longer correctly remembers the modified > window sizes. This is precisely why I'm creating my own script for this > purpose. > > On Wed, Sep 3, 2025 at 9:11=E2=80=AFAM killermoehre <[email protected]= > wrote: > >> Am Dienstag, dem 02.09.2025 um 14:26 +0300 schrieb Jack: >> >> 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 heigh= t >> of the monitor. The side windows (6,8) must be 1/2 the width and the ful= l >> 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 wi= th >> 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. >> >> Xfwm4 can already do this. You just need to map the key commands for thi= s. >> >> Check out xfwm4-settings =E2=86=92 Keyboard. >> >> BR >> Silvio >> _______________________________________________ >> Xfce mailing list >> [email protected] >> https://mail.xfce.org/mailman/listinfo/xfce >> http://www.xfce.org >> > --000000000000ae7aaa063de070e5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">btw. This also applies to the location.</div><br><div clas= s=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_att= r">On Wed, Sep 3, 2025 at 10:17=E2=80=AFAM Jack <<a href=3D"mailto:j4315= [email protected]">[email protected]</a>> wrote:<br></div><blockquote class= =3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg= b(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div dir=3D"ltr">Unfortun= ately, <b>built-in commands cannot be used</b> because after using them, th= e window size can no longer be changed programmatically (ie. from the scrip= ts). This is because if you switch to another desktop and then return, the = window manager no longer correctly remembers the modified window sizes. Thi= s is precisely why I'm creating my own script for this purpose.</div><b= r><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Wed, = Sep 3, 2025 at 9:11=E2=80=AFAM killermoehre <<a href=3D"mailto:killermoe= [email protected]" target=3D"_blank">[email protected]</a>> wrote:<br></div= ><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border= -left:1px solid rgb(204,204,204);padding-left:1ex"><p>Am Dienstag, dem 02.0= 9.2025 um 14:26 +0300 schrieb Jack:</p> <blockquote type=3D"cite"> <p>I require to <strong>Tile</strong> the currently active window into one = of the pre-defined positions listed below:</p> <p>1.The upper left corner<br> 2.The lower left corner<br> 3.The upper right corner<br> 4.The lower right 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</p> <p>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 h= eight of the monitor.</p> <p><strong>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 inter= pret the values and position the window to the EXACT (bit-by-bit) location = and size?</strong></p> <p>A simple code example (a bash script) that reads the values from the cur= rent active window and then moves the window to one of the corner positions= would be nice to examine.</p> <p>I intend to test the script by opening four terminal windows and subsequ= ently 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 applic= ation windows for example four browser windows etc.</p> <p>This initially appears to be a straightforward task, but in reality, it = is not simple at all.</p> <p>Thank you.</p> </blockquote> <p>Xfwm4 can already do this. You just need to map the key commands for thi= s.</p> <p>Check out xfwm4-settings =E2=86=92 Keyboard.</p> <p>BR<br> Silvio</p> _______________________________________________<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></div> </blockquote></div> --000000000000ae7aaa063de070e5-- --===============9074417648574204796== 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 --===============9074417648574204796==--