<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">That is quite normal.  Many older terminal programs (urxvt, xterm) define there size based on the number 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 tile-like layout on a display that automatically adjusts according to the physical display size.<br>
<br>
For this I ended up actually picking the font the xterm's is to use and from 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 occasionally due to window manager changes (title bar size and window border settings).</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">The script does all the calculations, 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="margin-top:0;margin-bottom:0">stored in a script "xset_resources"  and run using     eval `xset_resources`  as part of the x window client start up sequence.<br>
<br>
</p>
<div><span style="font-family: Consolas, Courier, monospace;"># ----- Collect Server information -----</span></div>
<div><span style="font-size: 12pt; font-family: Consolas, Courier, monospace;"># Get Display width and height...</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">eval `xrdb -symbols -screen | sed -n '/^-D\(WIDTH\|HEIGHT\)/{s/-D/X_/gp;}'`</span></div>
<div><br>
</div>
<br>
<div><span style="font-family: Consolas, Courier, monospace;"># ----- Basic Positionings of terminals -----</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">#</span></div>
<div><span style="font-family: Consolas, Courier, monospace;"># These values may also depend on my window manager setup</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">x1pos=5      # position of first (left) xterm window (gap for left gnome-panel)</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">y1pos=100    # space above xterm window, for other popup applications.</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">x2pos=''     # X location of right xterm windows calculated below</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">y2pos=$y1pos # Y location of right xterm is same as the first</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;">wgap=5      # window gaps (5) -- not used if $x2pos is defined</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">hbot=2      # enforced space at bottom of display (above a panel)</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">hgap=0      # an exact vertical gap between terminals (if non-zero)</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;"># XTerm application extras</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">wapp=15     # xterms extra width (scrollbar (9+2), text sep (2x2)</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">happ=4      # xterm extra height: internal seperation of text to window edge</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;"># OpenBox Decorations ( title is display DPI dependant? )</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">openbox_wdcr=4      # borders (2) X 2</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">openbox_hdcr=31     # titlebar (20) + handle (3) + borders (2) X 4 => 31</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;"># other previous window manager constants left out.</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;">xfce_left=60        # icons=48  2*( margin=3 box=1 magrin=2 )</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">xfce_bottom=28      # icons=16  2*( margin=3 box=1 magrin=2 )</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;"># ----- Display Size (Font and position changes) -----</span></div>
<div><br>
</div>
<span style="font-family: Consolas, Courier, monospace;"># this gets quite complex...  one example shown...</span><br>
<div><span style="font-family: Consolas, Courier, monospace;">if [ "$X_WIDTH" -gt "1600" ]; then      # ------ Wide Laptop Display ------</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">  [ "$VERBOSE" ] && echo "HDMI or Multi Screen Displays (Width>1600)"</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">  font_w=9; font_h=15                   # Standard xterm "large" font</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">  x1pos=50; wgap=30                     # increase intra-window gaps</span></div>
<div>
<div><span style="font-family: Consolas, Courier, monospace;">elif [ "$X_WIDTH" -eq "1400" ] ||</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">     [ "$X_WIDTH" -eq "1280" ]; then    # ------- Solaris/PC Display --------</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">  [ "$VERBOSE" ] && echo "PC Display (Width=1400 or Width=1280)"</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">  font_w=7; font_h=13                   # Slightly bigger font</span></div>
<span style="font-family: Consolas, Courier, monospace;"><br>
</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">#...</span></div>
<div><span style="font-family: Consolas, Courier, monospace;"><br>
</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">
<div>else                                  # ------- unknown display size ------</div>
<div>  echo >&2 "x_set_resources: unknown display size ${X_WIDTH}x${X_HEIGHT}"</div>
<div>  font_w=6; font_h=13                   # Default font</div>
<div><br>
</div>
fi</span></div>
<div><span style="font-family: Consolas, Courier, monospace;"><br>
</span></div>
<div><span style="font-family: Consolas, Courier, monospace;"># Font selection also complex...</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;"><br>
</span></div>
<div><span style="font-family: Consolas, Courier, monospace;"># Font selection using the pixel width and height... </span><span style="font-family: Consolas, Courier, monospace;">(Actually this is </span><span style="font-family: Consolas, Courier, monospace;">also
</span><span style="font-family: Consolas, Courier, monospace;">quite complex)</span></div>
<div>
<div>
<div><span style="font-family: Consolas, Courier, monospace;">FONT="-misc-fixed-medium-r-*-*-${font_h}-*-75-75-c-${font_w}0-iso10646-1"</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">BFONT="-misc-fixed-bold-r-*-*-${font_h}-*-75-75-c-${font_w}0-iso10646-1"</span></div>
<div><br>
</div>
</div>
<div>
<div><span style="font-family: Consolas, Courier, monospace;"># ----- Adjustments for window manager and panels -----</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;"># Assume no panels will be in use</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">X_LEFT_MARGIN=0</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">X_TOP_MARGIN=0</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">X_BOTTOM_MARGIN=0</span></div>
<div><span style="font-family: Consolas, Courier, monospace;"><br>
</span></div>
<div>
<div><span style="font-family: Consolas, Courier, monospace;"># Assume openbox decorations for windows</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">wdcr=$openbox_wdcr</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">hdcr=$openbox_hdcr</span></div>
<div><br>
</div>
</div>
<div><span style="font-family: Consolas, Courier, monospace;"># xfce4-panel</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">X_LEFT_MARGIN=$xfce_left</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">X_BOTTOM_MARGIN=$xfce_bottom</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;"># add margins to the windows appropriatally</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">x1pos=`expr $x1pos + $X_LEFT_MARGIN`</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">y1pos=`expr $y1pos + $X_TOP_MARGIN`</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">hbot=`expr $hbot + $X_BOTTOM_MARGIN`</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;"># ----- XTerm Size Calculations -----</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">#</span></div>
<div><span style="font-family: Consolas, Courier, monospace;"># Calculate placement xterm windows to fit font and display settings</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">width="`expr $font_w \* 80 + $wapp `"     # width = 80 columns + app width</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">height="`expr "$X_HEIGHT" - $y1pos - $hdcr - $happ - $hbot`"</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">                                          # height space available to use</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">rows=`expr  $height / $font_h`            # number of rows for large xterm</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">[ ! "$x2pos" ] &&                         # calc for side by side arrangment?</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">  x2pos="`expr $x1pos + $width + $wdcr + $wgap`" # x2pos = width + window gaps</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;">STDGEOM="${width}x${height}"              # standard window size (pixels)</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">XTERMGEOM_L="80x${rows}+${x1pos}+${y1pos}" # left side xterm</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">XTERMGEOM_R="80x${rows}+${x2pos}+${y2pos}" # right side xterm</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;"># Set up a two vertically stacked windows on the left hand side</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">height="`expr $height - $hdcr - $happ - $hgap`" # space lost by extra xterm</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">rows=`expr $height / $font_h`             # rows to divide between two terms</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">rows2=`expr $rows \* 1 / 4`               # divide text over two windows</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">rows1=`expr $rows - $rows2`</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">XTERMGEOM_L1="80x${rows1}+${x1pos}+${y1pos}"  # left top xterm window geometry</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;"># If no gap given, center lower window in the space left</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">height=`expr $height - $rows \* $font_h `    # more space lost to the text</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">[ "$hgap" -eq 0 ] && hgap=`expr $height / 2` # gap is half the remaining space</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">y2pos=`expr $y1pos + $rows1 \* $font_h + $hdcr + $happ + $hgap`</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">XTERMGEOM_L2="80x${rows2}+${x1pos}+${y2pos}"</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;"># use the upper left window size for default xterm size (with minimum)</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">[ ${rows1} -lt 25 ] && rows1=25</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">XTERMGEOM="80x${rows1}"</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;"># ------ Set Resources and Output Environmnt ------</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">#</span></div>
<div><span style="font-family: Consolas, Courier, monospace;"># Set X resources, including the font I picked above...</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">#</span></div>
<div><span style="font-family: Consolas, Courier, monospace;"># Do NOT let xrdb use "mcpp" for preprocessing.</span></div>
<div><span style="font-family: Consolas, Courier, monospace;"># As mcpp adds a space at end of defines, unless an option -@old or -@kr is</span></div>
<div><span style="font-family: Consolas, Courier, monospace;"># added (which cannot be added by users)</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">#</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">( cd;   # go home in a sub-shell as a precaution</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">  xrdb  -cpp /bin/cpp \</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">        -DHOME="$HOME" -DSTDGEOM="$STDGEOM" \</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">        -DFONT="$FONT" -DBFONT="$BFONT"     \</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">        -merge .Xresources</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">)</span></div>
<div><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace;">echo "X_WIDTH=\"$X_WIDTH\""</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">echo "X_HEIGHT=\"$X_HEIGHT\""</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">echo "STDGEOM=\"$STDGEOM\""</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">echo "XTERMGEOM=\"$XTERMGEOM\""</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">echo "XTERMGEOM_L=\"$XTERMGEOM_L\""</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">echo "XTERMGEOM_R=\"$XTERMGEOM_R\""</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">echo "XTERMGEOM_L1=\"$XTERMGEOM_L1\""</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">echo "XTERMGEOM_L2=\"$XTERMGEOM_L2\""</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">[ "$VERBOSE" ] && echo "FONT=\"$FONT\""</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">[ "$VERBOSE" ] && echo "BFONT=\"$BFONT\""</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">echo 'export X_WIDTH X_HEIGHT STDGEOM XTERMGEOM'</span></div>
<div><span style="font-family: Consolas, Courier, monospace;">echo 'export 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="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Enjoy...</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> openbox <openbox-bounces@icculus.org> on behalf of sunnycemetery@gmail.com <sunnycemetery@gmail.com><br>
<b>Sent:</b> Thursday, 1 November 2018 10:39:01 PM<br>
<b>To:</b> openbox@icculus.org<br>
<b>Subject:</b> Re: [openbox] Ignore size hint for specific applications</font>
<div> </div>
</div>
<div>> 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 specified window size. All windows are respecting this, except urxvt which is calculating 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 terminal emulators, I imagine) reports its window size as $COLUMNS × $LINES, yet sizing it to, say, 50% of the screen results in the correct pixel size. Example:<br>
<br>
<action name="MoveResizeTo"> <width>50%</width> <height>50%</height> <x>-0</x> <y>-0</y> </action><br>
<br>
This is one of those quirks that initially bothered me but has since become irrelevant.<br>
_______________________________________________<br>
openbox mailing list<br>
openbox@icculus.org<br>
<a href="http://icculus.org/mailman/listinfo/openbox">http://icculus.org/mailman/listinfo/openbox</a>
</div>
</body>
</html>