Re: FVWM: maximum # of windows

From: Mikhael Goikhman <migo_at_cortext.co.il>
Date: Mon, 11 Sep 2000 14:12:09 +0200

I gave up to explain and decided to do your homework. :)
Here is a solution for fvwm version 2.2.3 and up. It works surprizingly
well for me, but as I already said, for the betas I would implement more
correct, faster and less hardcoded solution.

Create this $HOME/bin/verify_netscape_windows script:

#!/bin/sh
: ${DISPLAY=:0}
NUM_LIMIT=6
num_total=`xwininfo -tree -root | grep Netscape | wc -l`
if [ "$num_total" -gt $NUM_LIMIT ]; then
        num_tokill=$[$num_total - $NUM_LIMIT]
        for wid in `xwininfo -tree -root | grep Netscape | \
        sed 's/ */ /g' | cut -d" " -f2 | head -$num_tokill`; do
                FvwmCommand "WindowId $wid Delete"
        done
fi

And add this line to your fvwm2rc (without 2 leading spaces):

  AddToFunc StartFunction I FvwmCommandS

There are 3 choices now (after restarting fvwm):
1) run the script verify_netscape_windows manually
2) run the script verify_netscape_windows from a cron job
3) run the script verify_netscape_windows automatically when fvwm places
a new window. For this to work, add the following lines to your fvwm2rc:

  *FvwmEventCmd Exec
  *FvwmEvent add_window verify_netscape_windows
  AddToFunc StartFunction I FvwmEvent

Tested for fvwm 2.2.4 & 2.3.21, Netscape 3 & 4.

Regards,
Mikhael.
--
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 Mon Sep 11 2000 - 07:13:22 BST

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