Re: FVWM: restricting oversize windows

From: Perry Hutchison <phutchis_at_beaverton.windriver.com>
Date: Fri, 3 Jan 2003 22:39:17 -0800 (PST)

> > Is it possible to configure 2.2.4 to restrict windows to the size of
> > the screen, even if -geometry requests larger?
> >
> > Motivation: I want an xterm just tall enough to display an entire
> > file, but no taller than the screen ...
...
> Use "xwininfo -root" to get the screen size, then substruct decorations
> (border size, title height), then substruct xterm's scroll bar, then
> divide by the font used in xterm (7x14), you should get the needed
> geometry for xterm.
>
> Or just do the right thing and run the latest stable 2.4.14, then do:
>
> Style XTerm MaxWindowSize $[vp.width]p $[vp.height]p

That is the sort of capability I had in mind.

For the sake of the archives, this is what I've ended up with for 2.2.4
using xwininfo. (My xterm seems to be using a 13-pixel font.)

  #!/usr/local/bin/bash
  maxl=`(xwininfo -root | sed -n -e 's/ Height: //p' ; echo 35 - 13 / p) | dc`
  xterm -geometry \
      "80x`(wc -l < $1 ; echo \"1 + d [$maxl p q] sa $maxl <a p q\") | dc`" \
      +sb -sl 0 -title $1 -n `basename $1` -e less $* &
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Sat Jan 04 2003 - 00:41:06 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:54 BST