W_RESIZE(1)                 General Commands Manual                W_RESIZE(1)



NAME
       w_resize - move/resize x11 app window

SYNOPSIS
       w_resize [-hHV]
       w_resize [-w lv]
       w_resize -R [wid]
       w_resize [-mr val] [wid]
       ([wid] == 0x1234| -a| none(==mouse select) )

TL_DR
       ~$ w_resize -a #>> output cmd for make window state
       #>> wmctrl -ir 0x1234 -e 1,70,868,1718,946

       ~$ w_resize -m 10,100,3 0x1234          # move to x10,y100,pinpos=3
       ~$ w_resize -r 100,200,1 0x1234         # resize to w100,h200,pinpos=1
       ~$ w_resize -R 0x1234         # reset resize


OPTIONS
       -hHV   usage, version

       -w lv  wmctrl/w_resize fails if CPU is too fast. add wait 0(dfl)-9
              ~$ w_resize -w 2 -m +10,y,1

       -a     use active window instead of wid

       -m val move. val is x,y,p == 100,200,1 / p1,x100,y200 etc.
              ~$ w_resize -m 100,y,1 #>> no change y val
              ~$ w_resize -m x100a%-10,p9,y #>> scrwidth-10pix

       -r val resize. val is w,h,p == 10,20,5 / w10,h20,p5 etc
              ~$ w_resize -r w,200,1 #>> no change width
              ~$ w_resize -r h200,p1,ww

       -R     reset resize

DESCRIPTION
       window  resize/move  helper. some app wmctrl/xdotool has the same func‐
       tion, but cause gap by window flame. this pg adjusts the  gap.   select
       window if wid isnt.

       -m/-r takes comma separated 3 values. basic seq is x,y,p / w,h,p.
       if  pfix  1  char  'x/y/m/h/p'  is  set,  seq is ignored. y10,p3,x100 /
       p1,h10,w20 etc.
       the last 'p' is resize/move pinning pos p=0-9.  p0 is  autopos.  p0==p2
       if -m opt. p0==p1/3/7/9 if -r opt.

         p1 *----*p2---* p3
            |          |     (app window)
         p4 *    *p5   * p6
            |          |
         p7 *----*p8---* p9

       'xywh' takes coordinate values. each value takes 'num-like' token holds
       some chars '%+-xywhab'.

            (case p1)
            +-----------------------+
            |          | 100y%      | screen
            | 100x%    |            | (workarea: taskbar is removed)
            | -------- +---+        |
            |          |win| 100h%  |
            |          +---+        | 100b%
            |          100w%        |
            +-----------------------+
              100a%

            - 'x/y/w/h/a/b' == '100x%/100y%/100w%/100h%/100a%/100b%'
            - '100%': treat as 100a/b/w/h%, depends on opt -m/r.

       value examples are the below:

            value token ERE: /[xymhp]?([-+]?[0-9]*[abxymh]?[%]?)+/

            w_resize -m 100,200,3    #>> absolute, x=100,y=200. basic-syntax
            w_resize -m p3,x100,y200 #>> sequence free if prefix is
            w_resize -m x100,y200,p3

            w_resize -m 0,0,1        #>> fit upper-left
            w_resize -m a,0,p3  #>> fit upeer-right
            w_resize -m 50a%,b,8     #>> fit bottom-center
            w_resize -m xa,yb,p9     #>> fit bottom-right
            w_resize -m p1 #>> special value p0-9/0-9 for -m opt
            w_resize -m 9  #>> fit bottom-right

            w_resize -m x100%,yy,p3  #>> fit p3 to screen right. keep y
            w_resize -m 100%,y,3
            w_resize -m x100a%,y,p3
            w_resize -m yy,p3,x100a%
            w_resize -m x100%-w,yy,p1     #>> same. calc with '-w', p1 <-> p3

            w_resize -m +10,-0,p1    #>> relative: start with '-+'. now+10 pix
            w_resize -m +10,yy,p1
            w_resize -m y,p1,x+10
            w_resize -m y100y%,p1,xx+10

            w_resize -m x,y,p1  #>> no move
            w_resize -m +0,-0,p1
            w_resize -m +0,yy,p1
            w_resize -m x+0,+0,p1
            w_resize -m x+0,y+0,p1
            w_resize -m +0%,y,p1
            w_resize -m x+0%,y,p1
            w_resize -m x+0x%,y,p1
            w_resize -m p1,y,x+0%

            w_resize -m x+20h%-10x%,yy+10w%,p1 #>> valid

            w_resize -r 200w%+10,-0,1     #>> resize to width 200%+10 pix
            w_resize -r w+w+10,h,1
            w_resize -r w+100%+10,hh,p1
            w_resize -r p1,w200w%+10,h-0



EXIT_STATUS
       suc/fail == 0/not0

NOTE
       'wmctrl' fails to set resize. retry the same command to fix pos/size.

DEPEND
       wmctrl, xprop, xwininfo

COMPAT
       posix-shell

COPYRIGHT
       Copyright (C) 2018 Momi-g, AGPLv3+

VERSION
       2022-12-21 v2.0.3 (2018-XX-XX v1.0.0)

SEE_ALSO
       wmctrl(1), xprop(1), xwininfo(1)

       https://specifications.freedesktop.org/wm-spec/wm-spec-lat‐
       est.html#idm140200472552416
       http://xjman.dsl.gr.jp/X11R6/X11/CH14.html
       https://www.x.org/releases/X11R7.7/doc/libX11/libX11/libX11.html#Set‐
       ting_and_Reading_the_WM_NORMAL_HINTS_Property




                                                                   W_RESIZE(1)
