Two "Wait" commands in a row hangs up.

Should this function cause fvwm to wait forever?

[code]DestroyFunc TestWait
AddToFunc TestWait

  • I Exec exec xterm -T title1
  • I Exec exec xterm -T title2
  • I Wait “title1”
  • I Wait “title2”
    [/code]
    I’d like to start 2 xterms on the same page, then switch to another page, but it waits forever on one of the waits. Sometimes it works, however. So try it several times at least, if you test it.
    Thanks - Skip

Oh, and I’m using fvwm version 2.5.14.

Of course it will hang – because by and large, by the time the wait commands are entered, the window has probably already been mapped, so it will wait forever. Note that in such situations, pressing “CTRL ALT ESC” will stop that.

As to your problem you need to rearrange it a little:

[code]DestroyFunc TestWait
AddToFunc TestWait

  • I Exec exec xterm -T title1
  • I Wait title1
  • I Exec exec xterm -T title2
  • I Wait “title2”
    [/code]

– Thomas Adam

Thanks for the prompt reply. I am actually generating the 2 xterms from a shell script (the code shown above was just to illustrate). Therefore, putting a Wait immediately after the xterm command is not possible because both xterms are generated by the one script. Any suggestions for that?
Skip

What is it you’re trying to do? And by script, if you spawn it via FVWM (say by converting it to a PipeRead) then that will block anyway – i.e. no further processing from FVWM takes place until the PipeRead ends.

– Thomas Adam

I have a bash shell script called “my2terms” which generates 2 xterms with specific geometry specs and placement on a page. It always creates 2. My2terms puts the jobs in background ala: “xterm &”, then exits. I like using this script because it creates the right geometry and placement. I could just put the geometry and placement in the fvwm config and will if there is no better way to do it, but that is redundant.
Thanks - Skip

Your script is redundant, more like. When you say “right geometry and placement” – can you explain to me how that differs from any of the existing methods that one can do for automatic sizing of windows? (Such as parameter expansion at the shell level, use of FvwmEvent via MoveResize, etc.)

I would put your script inside FVWM as a function, myself.

YMMV, etc, etc.

– Thomas Adam

I will take your advice and put the xterm command in fvwm’s config like so:

[code]DestroyFunc TestWait
AddToFunc TestWait

  • I Exec exec xterm -geom 80x60+0+4 -ls +sb -vb -ms yellow8 -font 9x15bold -T “Xterm - 1”
  • I Wait “Xterm - 1”
  • I Exec exec xterm -geom 80x60+4+0 -ls +sb -vb -ms yellow8 -font 9x15bold -T “Xterm - 2”
  • I Wait “Xterm - 2”
    [/code]
    Thanks for your help.
    Skip

Why do you want to wait for the xterms? The way you do it now it will be a waste of time since the second term won’t start loading until the first has loaded. What is it you want to achive with the waits?

I want to return to the page that I was on before issuing the cleanup. Here is my whole function:

[code]DestroyFunc Cleanup
AddToFunc Cleanup

  • I SetEnv curdesk $[desk.n]
  • I SetEnv curpagex $[page.nx]
  • I SetEnv curpagey $[page.ny]
  • I All (rxvt|xterm|rnd_rxvt) Destroy
  • I Style * HilightFore grey0, HilightBack $[MyFrameColor]
  • I TitleStyle ActiveUp (solid $[MyFrameColor] – Sunk)
  • I MenuStyle * Foreground black, Background $[MyMenuColor],
    ActiveFore NavajoWhite5
  • I Style * Color grey0/grey20
  • I Exec exec xsetroot -bg grey0 -fg grey10 -bitmap /usr/X11R6/include/X11/bitmaps/escherknot
  • I GotoDeskAndPage 0 0 0
  • I Exec exec xterm -geom 80x60+0+4 -T “Xterm - 1”
  • I Wait “Xterm - 1”
  • I Exec exec xterm -geom 80x60+4+0 -T “Xterm - 2”
  • I Wait “Xterm - 2”
  • I GotoDeskAndPage $[curdesk] $[curpagex] $[curpagey]
    [/code]

A few things to note (in no particular order):

  1. I assume you’re using FVWM 2.5.X – although in any case, be aware that the “Color” Style tag (and its ilk) is being phased out in favour of Colorsets, so be advised of that.

  2. Secondly, if you’re applying styles in functions (and you’re using 2.5.X) you should issue an ‘UpdateStyles’ command.

  3. I doubt very much you need the to wait for “Xterm - 1” – if you really want to wait before switching to the previous desk and page, just wait for “Xterm - 2” since by then it’s likely the first xterm would have loaded anyway.

  4. You’ve used SetEnv at the top of your function, yet I see no corresponding UnSetEnv commands; just a thought.

– Thomas.

Re: Your point 4.
I see now that I can use

+ I GotoDeskAndPage  prev

… then eliminate the SetEnv’s altogether.
Thanks for your help
Skip

You can, assuming that you started at 0 0 0. “prev” toggles between the last two locations visited, so unless you started from 0 0 0, when you actually do get to:

+ I GotoDeskAndPage 0 0 0

in your function and then do:

+ I GotoDeskAndPage prev

… as the very last command in it, you may well end up back in an erroneous place – hence why the use of SetEnvs here is not unreasonable.

– Thomas Adam