Re: FVWM: maximum # of windows

From: Czarina Caro L. Tablante 1995-24644 <ctablant_at_eee.upd.edu.ph>
Date: Fri, 8 Sep 2000 17:24:33 -0800 (GMT)

Hi! I'm having some trouble implementing this (pardon a newbie).

i added this to my .fvwm2rc :

*NewWindowEventCmd
*NewWindowPassId
*NewWindow add_window FuncFocusWindow

AddToFunc FuncFocusWindow
+ I PipeRead `windows "$w" "$n" "$r" "$c"

FvwmEvent NewWindowEvent

(end)

i'm really new with this stuff, and i've been reading everything i can
find on the web, but i cant find what those variables "$w", "$n", etc
are or where/how i can get them.

this is my windows script:

#!/bin/sh

info=$(xwininfo -display :0 -tree -root | grep Navigator | wc -l)
if [ "$info" -gt 3 ]; then
        FvwmCommand WindowId $w Delete
fi

(end)

i'm almost 100% sure what i did was incorrect. i dont get what u
mean by printing "WindowId $w Delete" to standard output too.

Thanks!


C

On Tue, 5 Sep 2000, Mikhael Goikhman wrote:

> On 05 Sep 2000 15:47:16 -0800, Czarina Caro L. Tablante 1995-24644 wrote:
> >
> > I need to make sure the # of netscape windows a user has at any
> > single session is limited to, say, 5. how do i make sure that this is
> > the case? i have other windows, there are sxpms which would be
> > included if i counted the # of windows open. i need to set a maximum
> > for the netscape windows only.
>
> Well, this is possible with a little shell+fvwmrc programming.
> To find how many Netscape (or other) windows are open execute:
>
> xwininfo -display :0 -tree -root | grep Netscape | wc -l
>
> Use 'grep -v 1x1+0+0' or similar to ignore the first Netscape window.
> Now there are 2 choices for you.
>
> 1) Define FvwmEvent with add_window like described here (for 2.3 and 2.2):
>
> http://www.hpc.uh.edu/fvwm/archive/0006/msg00382.html
> http://www.hpc.uh.edu/fvwm/archive/0006/msg00393.html
>
> Your add_window callback can be like this (works in the betas only):
>
> + I PipeRead `verify-window "$w" "$n" "$r" "$c"`
>
> verify-window is your shell script, which gets an id of a new window
> as the first parameter, name, resource name and resource class as the next
> parameters. Now, do what you want with this window: leave it, kill it.
> If you want to leave it, just do not output anything, otherwise print
> this fvwm command to the standard output: WindowId $w Delete.
>
> 2) You can run a cron job, which counts windows and kills (if needed)
> some of them (I hate to suggest this fascist mode, poor users). :-)
>
> xwininfo can give you id's of windows, experiment with:
>
> xwininfo -tree -root | grep Netscape | sed 's/ */ /g' | cut -d" " -f2
>
> To kill (dangerous) a window giving its id, execute:
>
> xkill -id 0x1215f2e
>
> Just tried xkill, it does not work well. I.e. it kills entire netscape,
> rather than only one window, it does not use X delete protocol.
>
> There is an alternative to xkill. Run FvwmCommandS in user's StartFunction
> and then execute a shell command from the cron job:
>
> FvwmCommand 'WindowId 0x1215f2e Delete'
>
> 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.
>
--
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 Fri Sep 08 2000 - 04:28:46 BST

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