Re: Getting and setting window size and position

Jack <[email protected]> Wed, 3 Sep 2025 16:10:16 +0300
Newsgroups gmane.comp.xfce.user
Message-ID <CAH8MQ5zcyrb_vVPox4n_5d6YBTwzSDoFh=GW1nd9iPZ1bEDdOw@mail.gmail.com>
--===============1104805565769583453==
Content-Type: multipart/alternative; boundary="000000000000157992063de554cf"

--000000000000157992063de554cf
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Here=E2=80=99s my script, which gets the job done. It should work with both
terminal-style and regular application windows in a multi-monitor setup.
Thank you.

#!/bin/bash

if [ $# -ne 2 ]; then
    echo "Usage: $0 <window_id> <command>"
    echo "<window_id> can be:"
    echo "  number      Window ID (e.g., 0x1a0000 or 123456)"
    echo "  '.'         Current active window"
    echo "  name        Partial window name (e.g., 'firefox')"
    echo "Commands:"
    echo "  -1          lower left corner"
    echo "  -2          bottom side"
    echo "  -3          lower right corner"
    echo "  -4          left side"
    echo "  -5          full screen"
    echo "  -6          right side"
    echo "  -7          upper left corner"
    echo "  -8          top side"
    echo "  -9          upper right corner"
    echo "  -gX,Y,W,H   move and resize"
    exit 1
fi

WINDOW_ID=3D"$1"
COMMAND=3D"$2"

# Handle WINDOW_ID input
if [ "$WINDOW_ID" =3D "." ]; then
    # Get active window ID
    WINDOW_ID=3D$(xdotool getactivewindow)
    if [ -z "$WINDOW_ID" ]; then
        echo "Error: No active window found"
        exit 1
    fi
elif [[ ! "$WINDOW_ID" =3D~ ^[0-9]+$ ]]; then
    # Treat as partial window name if not a number
    WINDOW_ID=3D$(wmctrl -l | grep -i "$WINDOW_ID" | head -n 1 | awk '{prin=
t
$1}')
    if [ -z "$WINDOW_ID" ]; then
        echo "Error: No window found matching partial name: $1"
        exit 1
    fi
fi

# Verify window ID is valid
if ! xwininfo -id "$WINDOW_ID" >/dev/null 2>&1; then
    echo "Error: Invalid window ID: $WINDOW_ID"
    exit 1
fi

wmctrl -ir "$WINDOW_ID" -b remove,maximized_vert,maximized_horz

ABSOLUTE_X=3D$(xwininfo -id "$WINDOW_ID" | grep "Absolute upper-left X:" |
awk '{print $4}')
ABSOLUTE_Y=3D$(xwininfo -id "$WINDOW_ID" | grep "Absolute upper-left Y:" |
awk '{print $4}')

RELATIVE_X=3D$(xwininfo -id "$WINDOW_ID" | grep "Relative upper-left X:" |
awk '{print $4}')
RELATIVE_Y=3D$(xwininfo -id "$WINDOW_ID" | grep "Relative upper-left Y:" |
awk '{print $4}')

WIDTH_FIX=3D$((-(RELATIVE_X * 2)))
HEIGHT_FIX=3D$((-(RELATIVE_Y + RELATIVE_X)))

MONITOR_INFO=3D$(xrandr --current)
MONITOR_X=3D0
MONITOR_Y=3D0
MONITOR_WIDTH=3D1920
MONITOR_HEIGHT=3D1080

# Loop through xrandr output to find the correct monitor based on window
position
while read -r line; do
    if [[ $line =3D~ ([0-9]+)x([0-9]+)\+([0-9]+)\+([0-9]+) ]]; then
        MON_W=3D${BASH_REMATCH[1]}
        MON_H=3D${BASH_REMATCH[2]}
        MON_X=3D${BASH_REMATCH[3]}
        MON_Y=3D${BASH_REMATCH[4]}

        # Check if the window is within this monitor's coordinates
        if (( ABSOLUTE_X >=3D MON_X && ABSOLUTE_X < MON_X + MON_W &&
ABSOLUTE_Y >=3D MON_Y && ABSOLUTE_Y < MON_Y + MON_H )); then
            MONITOR_WIDTH=3D$MON_W
            MONITOR_HEIGHT=3D$MON_H
            MONITOR_X=3D$MON_X
            MONITOR_Y=3D$MON_Y
            break
        fi
    fi
done <<< "$MONITOR_INFO"

HALF_WIDTH=3D$((MONITOR_WIDTH / 2))
HALF_HEIGHT=3D$((MONITOR_HEIGHT / 2))

case $COMMAND in
    -1)
        xdotool windowmove "$WINDOW_ID" $MONITOR_X $((MONITOR_Y +
HALF_HEIGHT))
        xdotool windowsize "$WINDOW_ID" $((HALF_WIDTH + WIDTH_FIX))
$((HALF_HEIGHT + HEIGHT_FIX))
        ;;
    -2)
        xdotool windowmove "$WINDOW_ID" $MONITOR_X $((MONITOR_Y +
HALF_HEIGHT))
        xdotool windowsize "$WINDOW_ID" $((MONITOR_WIDTH + WIDTH_FIX))
$((HALF_HEIGHT + HEIGHT_FIX))
        ;;
    -3)
        xdotool windowmove "$WINDOW_ID" $((MONITOR_X + HALF_WIDTH))
$((MONITOR_Y + HALF_HEIGHT))
        xdotool windowsize "$WINDOW_ID" $((HALF_WIDTH + WIDTH_FIX))
$((HALF_HEIGHT + HEIGHT_FIX))
        ;;
    -4)
        xdotool windowmove "$WINDOW_ID" $MONITOR_X $MONITOR_Y
        xdotool windowsize "$WINDOW_ID" $((HALF_WIDTH + WIDTH_FIX))
$((MONITOR_HEIGHT + HEIGHT_FIX))
        ;;
    -5)
        xdotool windowmove "$WINDOW_ID" $MONITOR_X $MONITOR_Y
        xdotool windowsize "$WINDOW_ID" $((MONITOR_WIDTH + WIDTH_FIX))
$((MONITOR_HEIGHT + HEIGHT_FIX))
        ;;
    -6)
        xdotool windowmove "$WINDOW_ID" $((MONITOR_X + HALF_WIDTH))
$MONITOR_Y
        xdotool windowsize "$WINDOW_ID" $((HALF_WIDTH + WIDTH_FIX))
$((MONITOR_HEIGHT + HEIGHT_FIX))
        ;;
    -7)
        xdotool windowmove "$WINDOW_ID" $MONITOR_X $MONITOR_Y
        xdotool windowsize "$WINDOW_ID" $((HALF_WIDTH + WIDTH_FIX))
$((HALF_HEIGHT + HEIGHT_FIX))
        ;;
    -8)
        xdotool windowmove "$WINDOW_ID" $MONITOR_X $MONITOR_Y
        xdotool windowsize "$WINDOW_ID" $((MONITOR_WIDTH + WIDTH_FIX))
$((HALF_HEIGHT + HEIGHT_FIX))
        ;;
    -9)
        xdotool windowmove "$WINDOW_ID" $((MONITOR_X + HALF_WIDTH))
$MONITOR_Y
        xdotool windowsize "$WINDOW_ID" $((HALF_WIDTH + WIDTH_FIX))
$((HALF_HEIGHT + HEIGHT_FIX))
        ;;
    -g*)
        GEOM=3D"${COMMAND:2}" # strip "-g"
        IFS=3D',' read -r GX GY GW GH <<< "$GEOM"
        if [[ -n $GX && -n $GY && -n $GW && -n $GH ]]; then
            xdotool windowmove "$WINDOW_ID" "$GX" "$GY"
            xdotool windowsize "$WINDOW_ID" "$((GW + WIDTH_FIX))" "$((GH +
HEIGHT_FIX))"
        else
            echo "Error: invalid geometry format. Use -gX,Y,W,H"
            exit 1
        fi
        ;;
    *)
        echo "Error: Unknown command: $COMMAND"
        exit 1
        ;;
esac


On Wed, Sep 3, 2025 at 10:43=E2=80=AFAM Jack <[email protected]> wrote:

> I have three monitors running six virtual desktops, all filled with
> applications some are tiled and some are floating. I'm currently writing =
a
> script to manage them, but it's making me consider just switching to i3 :=
)
>
> On Wed, Sep 3, 2025 at 10:29=E2=80=AFAM killermoehre <[email protected]=
t> wrote:
>
>> Am Mittwoch, dem 03.09.2025 um 10:17 +0300 schrieb Jack:
>>
>> Unfortunately, *built-in commands cannot be used* because after using
>> them, the window size can no longer be changed programmatically (ie. fro=
m
>> 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.
>>
>> A really long time ago I wrote
>> https://github.com/killermoehre/window-gridder for this purpose, but
>> abondend it, because Xfwm4 hat inbuild what I need and it has problems w=
ith
>> client side decorations.
>>
>> You can use it at a starting point.
>>
>> But IMHO it sounds like you want more of a tiling WM and not a floating
>> one, right? Xfce allows to simply *replace* the current WM with another
>> one. I wrote https://wiki.xfce.org/howto/other_window_manager for this.
>> _______________________________________________
>> Xfce mailing list
>> [email protected]
>> https://mail.xfce.org/mailman/listinfo/xfce
>> http://www.xfce.org
>>
>

--000000000000157992063de554cf
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Here=E2=80=99s my script, which gets the job done. It shou=
ld work with both terminal-style and regular application windows in a multi=
-monitor setup.<br>Thank you.<br><br>#!/bin/bash<br><br>if [ $# -ne 2 ]; th=
en<br>=C2=A0 =C2=A0 echo &quot;Usage: $0 &lt;window_id&gt; &lt;command&gt;&=
quot;<br>=C2=A0 =C2=A0 echo &quot;&lt;window_id&gt; can be:&quot;<br>=C2=A0=
 =C2=A0 echo &quot; =C2=A0number =C2=A0 =C2=A0 =C2=A0Window ID (e.g., 0x1a0=
000 or 123456)&quot;<br>=C2=A0 =C2=A0 echo &quot; =C2=A0&#39;.&#39; =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 Current active window&quot;<br>=C2=A0 =C2=A0 echo &quo=
t; =C2=A0name =C2=A0 =C2=A0 =C2=A0 =C2=A0Partial window name (e.g., &#39;fi=
refox&#39;)&quot;<br>=C2=A0 =C2=A0 echo &quot;Commands:&quot;<br>=C2=A0 =C2=
=A0 echo &quot; =C2=A0-1 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0lower left corne=
r&quot;<br>=C2=A0 =C2=A0 echo &quot; =C2=A0-2 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0bottom side&quot;<br>=C2=A0 =C2=A0 echo &quot; =C2=A0-3 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0lower right corner&quot;<br>=C2=A0 =C2=A0 echo &quot; =
=C2=A0-4 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0left side&quot;<br>=C2=A0 =C2=A0=
 echo &quot; =C2=A0-5 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0full screen&quot;<b=
r>=C2=A0 =C2=A0 echo &quot; =C2=A0-6 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0righ=
t side&quot;<br>=C2=A0 =C2=A0 echo &quot; =C2=A0-7 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0upper left corner&quot;<br>=C2=A0 =C2=A0 echo &quot; =C2=A0-8 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0top side&quot;<br>=C2=A0 =C2=A0 echo &quot; =
=C2=A0-9 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0upper right corner&quot;<br>=C2=
=A0 =C2=A0 echo &quot; =C2=A0-gX,Y,W,H =C2=A0 move and resize&quot;<br>=C2=
=A0 =C2=A0 exit 1<br>fi<br><br>WINDOW_ID=3D&quot;$1&quot;<br>COMMAND=3D&quo=
t;$2&quot;<br><br># Handle WINDOW_ID input<br>if [ &quot;$WINDOW_ID&quot; =
=3D &quot;.&quot; ]; then<br>=C2=A0 =C2=A0 # Get active window ID<br>=C2=A0=
 =C2=A0 WINDOW_ID=3D$(xdotool getactivewindow)<br>=C2=A0 =C2=A0 if [ -z &qu=
ot;$WINDOW_ID&quot; ]; then<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 echo &quot;Error=
: No active window found&quot;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 exit 1<br>=C2=
=A0 =C2=A0 fi<br>elif [[ ! &quot;$WINDOW_ID&quot; =3D~ ^[0-9]+$ ]]; then<br=
>=C2=A0 =C2=A0 # Treat as partial window name if not a number<br>=C2=A0 =C2=
=A0 WINDOW_ID=3D$(wmctrl -l | grep -i &quot;$WINDOW_ID&quot; | head -n 1 | =
awk &#39;{print $1}&#39;)<br>=C2=A0 =C2=A0 if [ -z &quot;$WINDOW_ID&quot; ]=
; then<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 echo &quot;Error: No window found mat=
ching partial name: $1&quot;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 exit 1<br>=C2=
=A0 =C2=A0 fi<br>fi<br><br># Verify window ID is valid<br>if ! xwininfo -id=
 &quot;$WINDOW_ID&quot; &gt;/dev/null 2&gt;&amp;1; then<br>=C2=A0 =C2=A0 ec=
ho &quot;Error: Invalid window ID: $WINDOW_ID&quot;<br>=C2=A0 =C2=A0 exit 1=
<br>fi<br><br>wmctrl -ir &quot;$WINDOW_ID&quot; -b remove,maximized_vert,ma=
ximized_horz<br><br>ABSOLUTE_X=3D$(xwininfo -id &quot;$WINDOW_ID&quot; | gr=
ep &quot;Absolute upper-left X:&quot; | awk &#39;{print $4}&#39;)<br>ABSOLU=
TE_Y=3D$(xwininfo -id &quot;$WINDOW_ID&quot; | grep &quot;Absolute upper-le=
ft Y:&quot; | awk &#39;{print $4}&#39;)<br><br>RELATIVE_X=3D$(xwininfo -id =
&quot;$WINDOW_ID&quot; | grep &quot;Relative upper-left X:&quot; | awk &#39=
;{print $4}&#39;)<br>RELATIVE_Y=3D$(xwininfo -id &quot;$WINDOW_ID&quot; | g=
rep &quot;Relative upper-left Y:&quot; | awk &#39;{print $4}&#39;)<br><br>W=
IDTH_FIX=3D$((-(RELATIVE_X * 2)))<br>HEIGHT_FIX=3D$((-(RELATIVE_Y + RELATIV=
E_X)))<br><br>MONITOR_INFO=3D$(xrandr --current)<br>MONITOR_X=3D0<br>MONITO=
R_Y=3D0<br>MONITOR_WIDTH=3D1920<br>MONITOR_HEIGHT=3D1080<br><br># Loop thro=
ugh xrandr output to find the correct monitor based on window position<br>w=
hile read -r line; do<br>=C2=A0 =C2=A0 if [[ $line =3D~ ([0-9]+)x([0-9]+)\+=
([0-9]+)\+([0-9]+) ]]; then<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 MON_W=3D${BASH_R=
EMATCH[1]}<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 MON_H=3D${BASH_REMATCH[2]}<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 MON_X=3D${BASH_REMATCH[3]}<br>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 MON_Y=3D${BASH_REMATCH[4]}<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 <br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 # Check if the window is within this monitor&#39;s=
 coordinates<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (( ABSOLUTE_X &gt;=3D MON_X =
&amp;&amp; ABSOLUTE_X &lt; MON_X + MON_W &amp;&amp; ABSOLUTE_Y &gt;=3D MON_=
Y &amp;&amp; ABSOLUTE_Y &lt; MON_Y + MON_H )); then<br>=C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 MONITOR_WIDTH=3D$MON_W<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 MONITOR_HEIGHT=3D$MON_H<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 MONITOR_X=3D$MON_X<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
MONITOR_Y=3D$MON_Y<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 break<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 fi<br>=C2=A0 =C2=A0 fi<br>done &lt;&lt;&lt; &qu=
ot;$MONITOR_INFO&quot;<br><br>HALF_WIDTH=3D$((MONITOR_WIDTH / 2))<br>HALF_H=
EIGHT=3D$((MONITOR_HEIGHT / 2))<br><br>case $COMMAND in<br>=C2=A0 =C2=A0 -1=
)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdotool windowmove &quot;$WINDOW_ID&quot; =
$MONITOR_X $((MONITOR_Y + HALF_HEIGHT))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdot=
ool windowsize &quot;$WINDOW_ID&quot; $((HALF_WIDTH + WIDTH_FIX)) $((HALF_H=
EIGHT + HEIGHT_FIX))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;;<br>=C2=A0 =C2=A0 -2)=
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdotool windowmove &quot;$WINDOW_ID&quot; $=
MONITOR_X $((MONITOR_Y + HALF_HEIGHT))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdoto=
ol windowsize &quot;$WINDOW_ID&quot; $((MONITOR_WIDTH + WIDTH_FIX)) $((HALF=
_HEIGHT + HEIGHT_FIX))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;;<br>=C2=A0 =C2=A0 -=
3)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdotool windowmove &quot;$WINDOW_ID&quot;=
 $((MONITOR_X + HALF_WIDTH)) $((MONITOR_Y + HALF_HEIGHT))<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 xdotool windowsize &quot;$WINDOW_ID&quot; $((HALF_WIDTH + WID=
TH_FIX)) $((HALF_HEIGHT + HEIGHT_FIX))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;;<br=
>=C2=A0 =C2=A0 -4)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdotool windowmove &quot;=
$WINDOW_ID&quot; $MONITOR_X $MONITOR_Y<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdoto=
ol windowsize &quot;$WINDOW_ID&quot; $((HALF_WIDTH + WIDTH_FIX)) $((MONITOR=
_HEIGHT + HEIGHT_FIX))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;;<br>=C2=A0 =C2=A0 -=
5)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdotool windowmove &quot;$WINDOW_ID&quot;=
 $MONITOR_X $MONITOR_Y<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdotool windowsize &q=
uot;$WINDOW_ID&quot; $((MONITOR_WIDTH + WIDTH_FIX)) $((MONITOR_HEIGHT + HEI=
GHT_FIX))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;;<br>=C2=A0 =C2=A0 -6)<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 xdotool windowmove &quot;$WINDOW_ID&quot; $((MONITOR_X=
 + HALF_WIDTH)) $MONITOR_Y<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdotool windowsiz=
e &quot;$WINDOW_ID&quot; $((HALF_WIDTH + WIDTH_FIX)) $((MONITOR_HEIGHT + HE=
IGHT_FIX))<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;;<br>=C2=A0 =C2=A0 -7)<br>=C2=A0=
 =C2=A0 =C2=A0 =C2=A0 xdotool windowmove &quot;$WINDOW_ID&quot; $MONITOR_X =
$MONITOR_Y<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdotool windowsize &quot;$WINDOW_=
ID&quot; $((HALF_WIDTH + WIDTH_FIX)) $((HALF_HEIGHT + HEIGHT_FIX))<br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 ;;<br>=C2=A0 =C2=A0 -8)<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 xdotool windowmove &quot;$WINDOW_ID&quot; $MONITOR_X $MONITOR_Y<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdotool windowsize &quot;$WINDOW_ID&quot; $((MO=
NITOR_WIDTH + WIDTH_FIX)) $((HALF_HEIGHT + HEIGHT_FIX))<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 ;;<br>=C2=A0 =C2=A0 -9)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdotoo=
l windowmove &quot;$WINDOW_ID&quot; $((MONITOR_X + HALF_WIDTH)) $MONITOR_Y<=
br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 xdotool windowsize &quot;$WINDOW_ID&quot; $(=
(HALF_WIDTH + WIDTH_FIX)) $((HALF_HEIGHT + HEIGHT_FIX))<br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 ;;<br>=C2=A0 =C2=A0 -g*)<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 GEOM=
=3D&quot;${COMMAND:2}&quot; # strip &quot;-g&quot;<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 IFS=3D&#39;,&#39; read -r GX GY GW GH &lt;&lt;&lt; &quot;$GEOM&quot;=
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 if [[ -n $GX &amp;&amp; -n $GY &amp;&amp; -=
n $GW &amp;&amp; -n $GH ]]; then<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 xdotool windowmove &quot;$WINDOW_ID&quot; &quot;$GX&quot; &quot;$GY&quo=
t;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 xdotool windowsize &quot;$W=
INDOW_ID&quot; &quot;$((GW + WIDTH_FIX))&quot; &quot;$((GH + HEIGHT_FIX))&q=
uot;<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 else<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 echo &quot;Error: invalid geometry format. Use -gX,Y,W,H&quot;<b=
r>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit 1<br>=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 fi<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;;<br>=C2=A0 =C2=A0 *)<br>=C2=A0 =
=C2=A0 =C2=A0 =C2=A0 echo &quot;Error: Unknown command: $COMMAND&quot;<br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 exit 1<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;;<br>esa=
c<div><br></div></div><br><div class=3D"gmail_quote gmail_quote_container">=
<div dir=3D"ltr" class=3D"gmail_attr">On Wed, Sep 3, 2025 at 10:43=E2=80=AF=
AM Jack &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt=
; 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"><div di=
r=3D"ltr"><div dir=3D"ltr">I have three monitors running six virtual deskto=
ps, all filled with applications some are tiled and some are floating. I&#3=
9;m currently writing a script to manage them, but it&#39;s making me consi=
der just switching to i3 :)</div><br><div class=3D"gmail_quote"><div dir=3D=
"ltr" class=3D"gmail_attr">On Wed, Sep 3, 2025 at 10:29=E2=80=AFAM killermo=
ehre &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">killermo=
[email protected]</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" styl=
e=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddin=
g-left:1ex"><p>Am Mittwoch, dem 03.09.2025 um 10:17 +0300 schrieb Jack:</p>
<blockquote type=3D"cite">
<p>Unfortunately, <strong>built-in commands cannot be used</strong> because=
 after using them, the window size can no longer be changed programmaticall=
y (ie. from the scripts). This is because if you switch to another desktop =
and then return, the window manager no longer correctly remembers the modif=
ied window sizes. This is precisely why I&#39;m creating my own script for =
this purpose.</p>
</blockquote>
<p>A really long time ago I wrote <a href=3D"https://github.com/killermoehr=
e/window-gridder" target=3D"_blank">https://github.com/killermoehre/window-=
gridder</a> for this purpose, but abondend it, because Xfwm4 hat inbuild wh=
at I need and it has problems with client side decorations.</p>
<p>You can use it at a starting point.</p>
<p>But IMHO it sounds like you want more of a tiling WM and not a floating =
one, right? Xfce allows to simply <em>replace</em> the current WM with anot=
her one. I wrote <a href=3D"https://wiki.xfce.org/howto/other_window_manage=
r" target=3D"_blank">https://wiki.xfce.org/howto/other_window_manager</a> f=
or this.</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>

--000000000000157992063de554cf--

--===============1104805565769583453==
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

--===============1104805565769583453==--