Re: Ignore size hint for specific applications

Anthony Thyssen <a.thyssen-YlX7AVbyhojX/[email protected]> Tue, 6 Nov 2018 06:57:01 +0000
Newsgroups gmane.comp.window-managers.openbox
Message-ID <SYXPR01MB20301433BD13020CF2C1857AB2CB0@SYXPR01MB2030.ausprd01.prod.outlook.com>
--===============2207464386154300840==
Content-Language: en-AU
Content-Type: multipart/alternative;
	boundary="_000_SYXPR01MB20301433BD13020CF2C1857AB2CB0SYXPR01MB2030ausp_"

--_000_SYXPR01MB20301433BD13020CF2C1857AB2CB0SYXPR01MB2030ausp_
Content-Type: text/plain; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable

That is quite normal.  Many older terminal programs (urxvt, xterm) define t=
here size based on the number of rows and columns of characters, rather tha=
n on a pixel dimension.

I myself had to deail with this as I wanted to place xterms in specific til=
e-like layout on a display that automatically adjusts according to the phys=
ical display size.

For this I ended up actually picking the font the xterm's is to use and fro=
m that calculating the pixel dimensions that would result for that window, =
so I can either define window positions, or adjust the row count (fixed 80 =
column width) to fit the desired height space available.   The script once =
made has been in general use for more than ten years, only being tweeked oc=
casionally due to window manager changes (title bar size and window border =
settings).


The script does all the calculations, sets xresources for the terminal wind=
ows, and exports some environment variables for the xterm geometry (size an=
d position) on screen.

Some code extracts (watch out for unicode substitutions by mailers)....

stored in a script "xset_resources"  and run using     eval `xset_resources=
`  as part of the x window client start up sequence.


# ----- Collect Server information -----
# Get Display width and height...
eval `xrdb -symbols -screen | sed -n '/^-D\(WIDTH\|HEIGHT\)/{s/-D/X_/gp;}'`


# ----- Basic Positionings of terminals -----
#
# These values may also depend on my window manager setup
x1pos=3D5      # position of first (left) xterm window (gap for left gnome-=
panel)
y1pos=3D100    # space above xterm window, for other popup applications.
x2pos=3D''     # X location of right xterm windows calculated below
y2pos=3D$y1pos # Y location of right xterm is same as the first

wgap=3D5      # window gaps (5) -- not used if $x2pos is defined
hbot=3D2      # enforced space at bottom of display (above a panel)
hgap=3D0      # an exact vertical gap between terminals (if non-zero)

# XTerm application extras
wapp=3D15     # xterms extra width (scrollbar (9+2), text sep (2x2)
happ=3D4      # xterm extra height: internal seperation of text to window e=
dge

# OpenBox Decorations ( title is display DPI dependant? )
openbox_wdcr=3D4      # borders (2) X 2
openbox_hdcr=3D31     # titlebar (20) + handle (3) + borders (2) X 4 =3D> 3=
1

# other previous window manager constants left out.

xfce_left=3D60        # icons=3D48  2*( margin=3D3 box=3D1 magrin=3D2 )
xfce_bottom=3D28      # icons=3D16  2*( margin=3D3 box=3D1 magrin=3D2 )

# ----- Display Size (Font and position changes) -----

# this gets quite complex...  one example shown...
if [ "$X_WIDTH" -gt "1600" ]; then      # ------ Wide Laptop Display ------
  [ "$VERBOSE" ] && echo "HDMI or Multi Screen Displays (Width>1600)"
  font_w=3D9; font_h=3D15                   # Standard xterm "large" font
  x1pos=3D50; wgap=3D30                     # increase intra-window gaps
elif [ "$X_WIDTH" -eq "1400" ] ||
     [ "$X_WIDTH" -eq "1280" ]; then    # ------- Solaris/PC Display ------=
--
  [ "$VERBOSE" ] && echo "PC Display (Width=3D1400 or Width=3D1280)"
  font_w=3D7; font_h=3D13                   # Slightly bigger font

#...

else                                  # ------- unknown display size ------
  echo >&2 "x_set_resources: unknown display size ${X_WIDTH}x${X_HEIGHT}"
  font_w=3D6; font_h=3D13                   # Default font

fi

# Font selection also complex...


# Font selection using the pixel width and height... (Actually this is also=
 quite complex)
FONT=3D"-misc-fixed-medium-r-*-*-${font_h}-*-75-75-c-${font_w}0-iso10646-1"
BFONT=3D"-misc-fixed-bold-r-*-*-${font_h}-*-75-75-c-${font_w}0-iso10646-1"

# ----- Adjustments for window manager and panels -----

# Assume no panels will be in use
X_LEFT_MARGIN=3D0
X_TOP_MARGIN=3D0
X_BOTTOM_MARGIN=3D0

# Assume openbox decorations for windows
wdcr=3D$openbox_wdcr
hdcr=3D$openbox_hdcr

# xfce4-panel
X_LEFT_MARGIN=3D$xfce_left
X_BOTTOM_MARGIN=3D$xfce_bottom

# add margins to the windows appropriatally
x1pos=3D`expr $x1pos + $X_LEFT_MARGIN`
y1pos=3D`expr $y1pos + $X_TOP_MARGIN`
hbot=3D`expr $hbot + $X_BOTTOM_MARGIN`

# ----- XTerm Size Calculations -----
#
# Calculate placement xterm windows to fit font and display settings
width=3D"`expr $font_w \* 80 + $wapp `"     # width =3D 80 columns + app wi=
dth
height=3D"`expr "$X_HEIGHT" - $y1pos - $hdcr - $happ - $hbot`"
                                          # height space available to use
rows=3D`expr  $height / $font_h`            # number of rows for large xter=
m
[ ! "$x2pos" ] &&                         # calc for side by side arrangmen=
t?
  x2pos=3D"`expr $x1pos + $width + $wdcr + $wgap`" # x2pos =3D width + wind=
ow gaps

STDGEOM=3D"${width}x${height}"              # standard window size (pixels)
XTERMGEOM_L=3D"80x${rows}+${x1pos}+${y1pos}" # left side xterm
XTERMGEOM_R=3D"80x${rows}+${x2pos}+${y2pos}" # right side xterm

# Set up a two vertically stacked windows on the left hand side
height=3D"`expr $height - $hdcr - $happ - $hgap`" # space lost by extra xte=
rm
rows=3D`expr $height / $font_h`             # rows to divide between two te=
rms
rows2=3D`expr $rows \* 1 / 4`               # divide text over two windows
rows1=3D`expr $rows - $rows2`
XTERMGEOM_L1=3D"80x${rows1}+${x1pos}+${y1pos}"  # left top xterm window geo=
metry

# If no gap given, center lower window in the space left
height=3D`expr $height - $rows \* $font_h `    # more space lost to the tex=
t
[ "$hgap" -eq 0 ] && hgap=3D`expr $height / 2` # gap is half the remaining =
space
y2pos=3D`expr $y1pos + $rows1 \* $font_h + $hdcr + $happ + $hgap`
XTERMGEOM_L2=3D"80x${rows2}+${x1pos}+${y2pos}"

# use the upper left window size for default xterm size (with minimum)
[ ${rows1} -lt 25 ] && rows1=3D25
XTERMGEOM=3D"80x${rows1}"

# ------ Set Resources and Output Environmnt ------
#
# Set X resources, including the font I picked above...
#
# Do NOT let xrdb use "mcpp" for preprocessing.
# As mcpp adds a space at end of defines, unless an option -@old or -@kr is
# added (which cannot be added by users)
#
( cd;   # go home in a sub-shell as a precaution
  xrdb  -cpp /bin/cpp \
        -DHOME=3D"$HOME" -DSTDGEOM=3D"$STDGEOM" \
        -DFONT=3D"$FONT" -DBFONT=3D"$BFONT"     \
        -merge .Xresources
)

echo "X_WIDTH=3D\"$X_WIDTH\""
echo "X_HEIGHT=3D\"$X_HEIGHT\""
echo "STDGEOM=3D\"$STDGEOM\""
echo "XTERMGEOM=3D\"$XTERMGEOM\""
echo "XTERMGEOM_L=3D\"$XTERMGEOM_L\""
echo "XTERMGEOM_R=3D\"$XTERMGEOM_R\""
echo "XTERMGEOM_L1=3D\"$XTERMGEOM_L1\""
echo "XTERMGEOM_L2=3D\"$XTERMGEOM_L2\""
[ "$VERBOSE" ] && echo "FONT=3D\"$FONT\""
[ "$VERBOSE" ] && echo "BFONT=3D\"$BFONT\""
echo 'export X_WIDTH X_HEIGHT STDGEOM XTERMGEOM'
echo 'export XTERMGEOM_L XTERMGEOM_R XTERMGEOM_L1 XTERMGEOM_L2'





Enjoy...


________________________________
From: openbox <[email protected]> on behalf of sunnycemetery@gmai=
l.com <[email protected]>
Sent: Thursday, 1 November 2018 10:39:01 PM
To: [email protected]
Subject: Re: [openbox] Ignore size hint for specific applications

> I'm using OpenBox as my window manager, and I have some hot keys configur=
ed to move windows into certain areas of the screen with a specified window=
 size. All windows are respecting this, except urxvt which is calculating i=
ts size based on the font size of the characters it is displaying.

Have you tried using percentages in your resize actions? XTerm (and most te=
rminal emulators, I imagine) reports its window size as $COLUMNS =D7 $LINES=
, yet sizing it to, say, 50% of the screen results in the correct pixel siz=
e. Example:

<action name=3D"MoveResizeTo"> <width>50%</width> <height>50%</height> <x>-=
0</x> <y>-0</y> </action>

This is one of those quirks that initially bothered me but has since become=
 irrelevant.
_______________________________________________
openbox mailing list
[email protected]
http://icculus.org/mailman/listinfo/openbox<http://icculus.org/mailman/list=
info/openbox>

--_000_SYXPR01MB20301433BD13020CF2C1857AB2CB0SYXPR01MB2030ausp_
Content-Type: text/html; charset=WINDOWS-1252
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" style=3D"display:none;"><!-- P {margin-top:0;margi=
n-bottom:0;} --></style>
</head>
<body dir=3D"ltr">
<div id=3D"divtagdefaultwrapper" style=3D"font-size:12pt;color:#000000;font=
-family:Calibri,Helvetica,sans-serif;" dir=3D"ltr">
<p style=3D"margin-top:0;margin-bottom:0">That is quite normal.&nbsp; Many =
older terminal programs (urxvt, xterm) define there size based on the numbe=
r of rows and columns of characters, rather than on a pixel dimension.<br>
<br>
I myself had to deail with this as I wanted to place xterms in specific til=
e-like layout on a display that automatically adjusts according to the phys=
ical display size.<br>
<br>
For this I ended up actually picking the&nbsp;font the xterm's is to use an=
d from that calculating the pixel dimensions that would result for that win=
dow, so I can either define window positions, or adjust the row count (fixe=
d&nbsp;80 column width) to fit the desired&nbsp;height
 space available.&nbsp; &nbsp;The script once made has been in general use =
for more&nbsp;than ten years, only being tweeked occasionally due to window=
 manager changes (title bar size and window border settings).</p>
<p style=3D"margin-top:0;margin-bottom:0"><br>
</p>
<p style=3D"margin-top:0;margin-bottom:0">The script does all the calculati=
ons, sets xresources for the terminal windows, and exports some environment=
 variables for the xterm geometry (size and position) on screen.<br>
<br>
Some code extracts (watch out for unicode substitutions by mailers)....</p>
<p style=3D"margin-top:0;margin-bottom:0">stored in a script &quot;xset_res=
ources&quot;&nbsp; and run using&nbsp; &nbsp; &nbsp;eval `xset_resources`&n=
bsp; as part of the x window client start up sequence.<br>
<br>
</p>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># ----- Col=
lect Server information -----</span></div>
<div><span style=3D"font-size: 12pt; font-family: Consolas, Courier, monosp=
ace;"># Get Display width and height...</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">eval `xrdb =
-symbols -screen | sed -n '/^-D\(WIDTH\|HEIGHT\)/{s/-D/X_/gp;}'`</span></di=
v>
<div><br>
</div>
<br>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># ----- Bas=
ic Positionings of terminals -----</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">#</span></d=
iv>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># These val=
ues may also depend on my window manager setup</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">x1pos=3D5&n=
bsp; &nbsp; &nbsp; # position of first (left) xterm window (gap for left gn=
ome-panel)</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">y1pos=3D100=
&nbsp; &nbsp; # space above xterm window, for other popup applications.</sp=
an></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">x2pos=3D''&=
nbsp; &nbsp; &nbsp;# X location of right xterm windows calculated below</sp=
an></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">y2pos=3D$y1=
pos # Y location of right xterm is same as the first</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">wgap=3D5&nb=
sp; &nbsp; &nbsp; # window gaps (5) -- not used if $x2pos is defined</span>=
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">hbot=3D2&nb=
sp; &nbsp; &nbsp; # enforced space at bottom of display (above a panel)</sp=
an></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">hgap=3D0&nb=
sp; &nbsp; &nbsp; # an exact vertical gap between terminals (if non-zero)</=
span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># XTerm app=
lication extras</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">wapp=3D15&n=
bsp; &nbsp; &nbsp;# xterms extra width (scrollbar (9+2), text sep (2x2)</sp=
an></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">happ=3D4&nb=
sp; &nbsp; &nbsp; # xterm extra height: internal seperation of text to wind=
ow edge</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># OpenBox D=
ecorations ( title is display DPI dependant? )</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">openbox_wdc=
r=3D4&nbsp; &nbsp; &nbsp; # borders (2) X 2</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">openbox_hdc=
r=3D31&nbsp; &nbsp; &nbsp;# titlebar (20) + handle (3) + borders (2) X 4 =
=3D&gt; 31</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># other pre=
vious window manager constants left out.</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">xfce_left=
=3D60&nbsp; &nbsp; &nbsp; &nbsp; # icons=3D48&nbsp; 2*( margin=3D3 box=3D1 =
magrin=3D2 )</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">xfce_bottom=
=3D28&nbsp; &nbsp; &nbsp; # icons=3D16&nbsp; 2*( margin=3D3 box=3D1 magrin=
=3D2 )</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># ----- Dis=
play Size (Font and position changes) -----</span></div>
<div><br>
</div>
<span style=3D"font-family: Consolas, Courier, monospace;"># this gets quit=
e complex...&nbsp; one example shown...</span><br>
<div><span style=3D"font-family: Consolas, Courier, monospace;">if [ &quot;=
$X_WIDTH&quot; -gt &quot;1600&quot; ]; then&nbsp; &nbsp; &nbsp; # ------ Wi=
de Laptop Display ------</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">&nbsp; [ &q=
uot;$VERBOSE&quot; ] && echo &quot;HDMI or Multi Screen Displays (Width&gt;=
1600)&quot;</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">&nbsp; font=
_w=3D9; font_h=3D15&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;# Standard xterm &quot;large&quot; font</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">&nbsp; x1po=
s=3D50; wgap=3D30&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp;# increase intra-window gaps</span></div>
<div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">elif [ &quo=
t;$X_WIDTH&quot; -eq &quot;1400&quot; ] ||</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">&nbsp; &nbs=
p; &nbsp;[ &quot;$X_WIDTH&quot; -eq &quot;1280&quot; ]; then&nbsp; &nbsp; #=
 ------- Solaris/PC Display --------</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">&nbsp; [ &q=
uot;$VERBOSE&quot; ] && echo &quot;PC Display (Width=3D1400 or Width=3D1280=
)&quot;</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">&nbsp; font=
_w=3D7; font_h=3D13&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp;# Slightly bigger font</span></div>
<span style=3D"font-family: Consolas, Courier, monospace;"><br>
</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">#...</span>=
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"><br>
</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">
<div>else&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # ------- unknown disp=
lay size ------</div>
<div>&nbsp; echo &gt;&2 &quot;x_set_resources: unknown display size ${X_WID=
TH}x${X_HEIGHT}&quot;</div>
<div>&nbsp; font_w=3D6; font_h=3D13&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp;# Default font</div>
<div><br>
</div>
fi</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"><br>
</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># Font sele=
ction also complex...</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"><br>
</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># Font sele=
ction using the pixel width and height...&nbsp;</span><span style=3D"font-f=
amily: Consolas, Courier, monospace;">(Actually this is&nbsp;</span><span s=
tyle=3D"font-family: Consolas, Courier, monospace;">also
</span><span style=3D"font-family: Consolas, Courier, monospace;">quite com=
plex)</span></div>
<div>
<div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">FONT=3D&quo=
t;-misc-fixed-medium-r-*-*-${font_h}-*-75-75-c-${font_w}0-iso10646-1&quot;<=
/span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">BFONT=3D&qu=
ot;-misc-fixed-bold-r-*-*-${font_h}-*-75-75-c-${font_w}0-iso10646-1&quot;</=
span></div>
<div><br>
</div>
</div>
<div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># ----- Adj=
ustments for window manager and panels -----</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># Assume no=
 panels will be in use</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">X_LEFT_MARG=
IN=3D0</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">X_TOP_MARGI=
N=3D0</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">X_BOTTOM_MA=
RGIN=3D0</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"><br>
</span></div>
<div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># Assume op=
enbox decorations for windows</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">wdcr=3D$ope=
nbox_wdcr</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">hdcr=3D$ope=
nbox_hdcr</span></div>
<div><br>
</div>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># xfce4-pan=
el</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">X_LEFT_MARG=
IN=3D$xfce_left</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">X_BOTTOM_MA=
RGIN=3D$xfce_bottom</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># add margi=
ns to the windows appropriatally</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">x1pos=3D`ex=
pr $x1pos + $X_LEFT_MARGIN`</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">y1pos=3D`ex=
pr $y1pos + $X_TOP_MARGIN`</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">hbot=3D`exp=
r $hbot + $X_BOTTOM_MARGIN`</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># ----- XTe=
rm Size Calculations -----</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">#</span></d=
iv>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># Calculate=
 placement xterm windows to fit font and display settings</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">width=3D&qu=
ot;`expr $font_w \* 80 + $wapp `&quot;&nbsp; &nbsp; &nbsp;# width =3D 80 co=
lumns + app width</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">height=3D&q=
uot;`expr &quot;$X_HEIGHT&quot; - $y1pos - $hdcr - $happ - $hbot`&quot;</sp=
an></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">&nbsp; &nbs=
p; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # height space=
 available to use</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">rows=3D`exp=
r&nbsp; $height / $font_h`&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # numbe=
r of rows for large xterm</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">[ ! &quot;$=
x2pos&quot; ] &&&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp;# calc for side by side arrangment?</span></=
div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">&nbsp; x2po=
s=3D&quot;`expr $x1pos + $width + $wdcr + $wgap`&quot; # x2pos =3D width + =
window gaps</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">STDGEOM=3D&=
quot;${width}x${height}&quot;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbs=
p; # standard window size (pixels)</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">XTERMGEOM_L=
=3D&quot;80x${rows}+${x1pos}+${y1pos}&quot; # left side xterm</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">XTERMGEOM_R=
=3D&quot;80x${rows}+${x2pos}+${y2pos}&quot; # right side xterm</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># Set up a =
two vertically stacked windows on the left hand side</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">height=3D&q=
uot;`expr $height - $hdcr - $happ - $hgap`&quot; # space lost by extra xter=
m</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">rows=3D`exp=
r $height / $font_h`&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# rows =
to divide between two terms</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">rows2=3D`ex=
pr $rows \* 1 / 4`&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# =
divide text over two windows</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">rows1=3D`ex=
pr $rows - $rows2`</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">XTERMGEOM_L=
1=3D&quot;80x${rows1}+${x1pos}+${y1pos}&quot;&nbsp; # left top xterm window=
 geometry</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># If no gap=
 given, center lower window in the space left</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">height=3D`e=
xpr $height - $rows \* $font_h `&nbsp; &nbsp; # more space lost to the text=
</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">[ &quot;$hg=
ap&quot; -eq 0 ] && hgap=3D`expr $height / 2` # gap is half the remaining s=
pace</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">y2pos=3D`ex=
pr $y1pos + $rows1 \* $font_h + $hdcr + $happ + $hgap`</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">XTERMGEOM_L=
2=3D&quot;80x${rows2}+${x1pos}+${y2pos}&quot;</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># use the u=
pper left window size for default xterm size (with minimum)</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">[ ${rows1} =
-lt 25 ] && rows1=3D25</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">XTERMGEOM=
=3D&quot;80x${rows1}&quot;</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># ------ Se=
t Resources and Output Environmnt ------</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">#</span></d=
iv>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># Set X res=
ources, including the font I picked above...</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">#</span></d=
iv>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># Do NOT le=
t xrdb use &quot;mcpp&quot; for preprocessing.</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># As mcpp a=
dds a space at end of defines, unless an option -@old or -@kr is</span></di=
v>
<div><span style=3D"font-family: Consolas, Courier, monospace;"># added (wh=
ich cannot be added by users)</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">#</span></d=
iv>
<div><span style=3D"font-family: Consolas, Courier, monospace;">( cd;&nbsp;=
 &nbsp;# go home in a sub-shell as a precaution</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">&nbsp; xrdb=
&nbsp; -cpp /bin/cpp \</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">&nbsp; &nbs=
p; &nbsp; &nbsp; -DHOME=3D&quot;$HOME&quot; -DSTDGEOM=3D&quot;$STDGEOM&quot=
; \</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">&nbsp; &nbs=
p; &nbsp; &nbsp; -DFONT=3D&quot;$FONT&quot; -DBFONT=3D&quot;$BFONT&quot;&nb=
sp; &nbsp; &nbsp;\</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">&nbsp; &nbs=
p; &nbsp; &nbsp; -merge .Xresources</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">)</span></d=
iv>
<div><br>
</div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">echo &quot;=
X_WIDTH=3D\&quot;$X_WIDTH\&quot;&quot;</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">echo &quot;=
X_HEIGHT=3D\&quot;$X_HEIGHT\&quot;&quot;</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">echo &quot;=
STDGEOM=3D\&quot;$STDGEOM\&quot;&quot;</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">echo &quot;=
XTERMGEOM=3D\&quot;$XTERMGEOM\&quot;&quot;</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">echo &quot;=
XTERMGEOM_L=3D\&quot;$XTERMGEOM_L\&quot;&quot;</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">echo &quot;=
XTERMGEOM_R=3D\&quot;$XTERMGEOM_R\&quot;&quot;</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">echo &quot;=
XTERMGEOM_L1=3D\&quot;$XTERMGEOM_L1\&quot;&quot;</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">echo &quot;=
XTERMGEOM_L2=3D\&quot;$XTERMGEOM_L2\&quot;&quot;</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">[ &quot;$VE=
RBOSE&quot; ] && echo &quot;FONT=3D\&quot;$FONT\&quot;&quot;</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">[ &quot;$VE=
RBOSE&quot; ] && echo &quot;BFONT=3D\&quot;$BFONT\&quot;&quot;</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">echo 'expor=
t X_WIDTH X_HEIGHT STDGEOM XTERMGEOM'</span></div>
<div><span style=3D"font-family: Consolas, Courier, monospace;">echo 'expor=
t XTERMGEOM_L XTERMGEOM_R XTERMGEOM_L1 XTERMGEOM_L2'</span></div>
<div><br>
</div>
<br>
</div>
<div></div>
<div><br>
</div>
</div>
<p></p>
<p style=3D"margin-top:0;margin-bottom:0"><br>
</p>
<p style=3D"margin-top:0;margin-bottom:0">Enjoy...</p>
<p style=3D"margin-top:0;margin-bottom:0"><br>
</p>
</div>
<hr style=3D"display:inline-block;width:98%" tabindex=3D"-1">
<div id=3D"divRplyFwdMsg" dir=3D"ltr"><font face=3D"Calibri, sans-serif" st=
yle=3D"font-size:11pt" color=3D"#000000"><b>From:</b> openbox &lt;openbox-b=
[email protected]&gt; on behalf of [email protected] &lt;sunnycemete=
[email protected]&gt;<br>
<b>Sent:</b> Thursday, 1 November 2018 10:39:01 PM<br>
<b>To:</b> [email protected]<br>
<b>Subject:</b> Re: [openbox] Ignore size hint for specific applications</f=
ont>
<div>&nbsp;</div>
</div>
<div>&gt; I'm using OpenBox as my window manager, and I have some hot keys =
configured to move windows into certain areas of the screen with a specifie=
d window size. All windows are respecting this, except urxvt which is calcu=
lating its size based on the font size
 of the characters it is displaying.<br>
<br>
Have you tried using percentages in your resize actions? XTerm (and most te=
rminal emulators, I imagine) reports its window size as $COLUMNS =D7 $LINES=
, yet sizing it to, say, 50% of the screen results in the correct pixel siz=
e. Example:<br>
<br>
&lt;action name=3D&quot;MoveResizeTo&quot;&gt; &lt;width&gt;50%&lt;/width&g=
t; &lt;height&gt;50%&lt;/height&gt; &lt;x&gt;-0&lt;/x&gt; &lt;y&gt;-0&lt;/y=
&gt; &lt;/action&gt;<br>
<br>
This is one of those quirks that initially bothered me but has since become=
 irrelevant.<br>
_______________________________________________<br>
openbox mailing list<br>
[email protected]<br>
<a href=3D"http://icculus.org/mailman/listinfo/openbox">http://icculus.org/=
mailman/listinfo/openbox</a>
</div>
</body>
</html>

--_000_SYXPR01MB20301433BD13020CF2C1857AB2CB0SYXPR01MB2030ausp_--


--===============2207464386154300840==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18Kb3BlbmJveCBt
YWlsaW5nIGxpc3QKb3BlbmJveEBpY2N1bHVzLm9yZwpodHRwOi8vaWNjdWx1cy5vcmcvbWFpbG1h
bi9saXN0aW5mby9vcGVuYm94

--===============2207464386154300840==--