FVWM: Re: Timing problems with Close?

From: David S. Goldberg <dsg_at_linus.mitre.org>
Date: 06 Jun 1997 08:43:32 -0400

I don't know if it's possible to do what you want directly in your
fvwm config file, but if you're willing to let an external shell do
the work for you, you can take advantage of the FvwmCommand module
(it's in the extras directory). For example, I do the following in my
.X11Startup:

doweb(){
    FvwmCommand 'Style "Netscape" StartsOnDesk 5, SkipMapping'
    $HOME/bin/xcmd netscape -geometry 900x725+1+1
    until [ `xwininfo -root -tree | grep -c Netscape` -eq 2 ] ; do
        sleep 1
    done
    FvwmCommand 'Style "Netscape" StartsAnyWhere, ShowMapping'
}

This ensures that when I fire up netscape at login, it's first window
goes on desk number 5. I look for two windows because (I'm guessing)
netscape seems to have an unmapped second window that actually gets
created first (you can't imagine how long it took me to debug that!).
But anyway, after that, I use browse-url within emacs to pop up web
pages and I don't want to have to jump to desk 5 to see them. Thus,
after I detect that netscape has started and mapped its window, I
reset the style to StartsAnywhere. For a long while I'd been doing
this manually with a hardcoded Style and used FvwmTalk and then
FvwmConsole to do the reset to StartsAnywhere. When I discovered
FvwmCommand, boy was I psyched! I can see this method being used in
the following manner for your situation:

In a shell script called, say fvwmclose.sh:

#!/bin/sh
until ! xwininfo -id $1 >/dev/null 2>&1 ; do
sleep 1
done
FvwmCommand your_focus_function_here

Where your my_close function calls Close and then Execs the shell
script with $w as argument.

It's almost certainly not very efficient, but it should work well
enough to keep you happy. Note, though, that I have not tested the
above at all (except for the syntax of the until loop). Your mileage
may vary and the rest of the usual disclaimers apply.

hth,

--
Dave Goldberg
Post: The Mitre Corporation\MS B305\202 Burlington Rd.\Bedford, MA 01730
Phone: 617-271-3887
Email: dsg_at_mitre.org
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Fri Jun 06 1997 - 07:44:08 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:00 BST