XTerm and Others - Change font size but keep geometry

Dear Community,
I am playing with terminals in X11 using x11-wm/twm. Twm is a simple window manager which supports floating windows. The XTerm are configured to use true type fonts. I can place an instance of Xterm with the geometry option. This allows to specify the size of the XTerm in terms of columns and rows. Additionally the offset to the displays origin (this is often the upper left corner) can be defined in pixel.

In XTerm but also other terminals as xfce4-terminal or lx-terminal the font size can be changed during runtime. This can be done using menus, key combinations or so. Doing so the the geometry of the terminal is unchanged. That means that offset to the origin of the display is kept. Since the dimensions of the terminal are specified in columns and rows the size in pixel changes when the font size is changed.

I would like to change the font but keep the space consumed by the terminal measured in pixel unchanged.

  1. Is there any method to change the font size but keeping the dimension in pixels almost unchanged?
  2. Or can I query the actual font size of the terminal? That should allow me to change the font size in one step and correct the geometry in a second step.
Thank you for your ideas in advance,
Christoph
 
Dear Community,
at least there is a work around :-). Now I have a x11-wm/twm with a status bar x11/dzen2 at the top and the remaining area for terminals. In a terminal I can of course run sysutils/tmux or so. Floating windows are still possible. By doing so I have something like a single window of a tiling window manager which is a little bit minimalistic. Twm is configured to allow going through the stack of windows up and down by key shortcuts. That setup is working nicely.

Regarding the initial posting please see below my work around script which is started by pressing a short cut. x11/xdotool reads the window id of the active window and x11/xwininfo the size of the root screen. The active window is moved below the status bar and expanded to fill the remaining space below. I dig not dig to find out why the offset in height of 60 exceeds the configured height of the status bar. I just tried that. That script works also to maximize the screen area of other tools as firefox while keeping the status bar free.
Code:
#!/bin/sh

w_id=$(xdotool getwindowfocus)
width=$(xwininfo -root|grep "Width"|sed -e 's/[^0-9]//g')
height=$(xwininfo -root|grep "Height"|sed -e 's/[^0-9]//g')
xdotool windowmove $w_id 0 30
xdotool windowsize $w_id $width $(($height-60))
May be the script or the ideas are of interest for anybody. Thank you to the maintainers, who take care that we have so many useful tools in our FreeBSD-box-of-tricks.
Kind regards,
Christoph
 
Back
Top