Subject: Re: FVWM: Argument Passing?

From: [email-masked]
Date: Sat, 15 Jan 2000 15:35:03 GMT

> From: "Thomas A. Gardiner" <[email-masked]>

> The first suggestion.
>
> AddToFunc SwitchDecor
> + "I" Exec echo $0 > HOME/USER_WM_STYLE
> + "I" Restart HOME/bin/RunWM
>

> >> In other places where I want to wait for an Exec to complete before moving on
> >> I use PipeRead instead: so, one could try:
> >> 
> >>          AddToFunc SwitchDecor
> >>          + "I" PipeRead "echo $0 > HOME/USER_WM_STYLE"
> >>          + "I" Restart HOME/bin/RunWM
>
> This suggestion works just fine for me.  There is one interesting
> difference from the first suggestion above.  I pipe stdout and stderr to
> ~/.FVWM2-errors with
>
> fvwm2 -cmd 'FvwmM4 fvwm2rc.m4' > ~/.FVWM2-errors 2>&1
>
> The first suggestion causes the output of subsequent restarts to be
> appended to the file.  The second suggestion causes the file to be
> overwritten.  There is definitely something going on here, but I'll be
> damned if I know what...

That's odd: one would expect BOTH to overwite the file, as the fvwm2 process
is being replaced by a new instance of RunWM, which is then replaced
(presumably) by a new instance of fvwm2.

On the other hand, a simple Restart, or Restart fvwm2 (I think) does NOT
replace the current process, merely `restarts' it: so the output is appended.
Perhaps when you tried the first method it was really somehow just doing a
Restart fvwm2?

>
> The third suggestion gives me an error for some unknown reason.
>
> >>          AddToFunc SwitchDecor
> >>          + "I" PipeRead "echo $0 > HOME/USER_WM_STYLE; echo Restart HOME/bin/
> >> RunWM"
>
> [FVWM][Done]: <<ERROR>> Call of '/home/tom/bin/RunWM' failed!!!! 
> (restarting 'fvwm2' instead)
>
> Anyone have an idea why???  I guess it doesn't matter, the second
> suggestion works.  I should just use it and move on...

Ah yes! I've seen this one before. Was your error really:

	[FVWM][Done]: <<ERROR>> Call of '/home/tom/bin/RunWM
	' failed!!!!
	(restarting 'fvwm2' instead)

i.e. a new line inside the quotes?

The text I suggested should have had a -n on the second echo:

	+ "I" PipeRead "echo $0 > HOME/USER_WM_STYLE; echo -n Restart HOME/bin/RunWM

I don't know why -- can anybody explain? The trailing newline from the
PipeRead gets treated as part of the name of the process for the Restart
command. Is this a bug?

John Latham
--
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: "Thomas A. Gardiner" <[email-masked]>
Date: Sat, 15 Jan 2000 14:43:33 -0500 (EST)

Previously...

>Perhaps when you tried the first method it was really somehow just doing a

Sounds reasonable...

>i.e. a new line inside the quotes?

Yes!  I thought it was just a funny syntax for the error message...

> + "I" PipeRead "echo $0 > HOME/USER_WM_STYLE; echo -n Restart HOME/bin/RunWM

Damn... That's good.  How'd you figure that one out?

>PipeRead gets treated as part of the name of the process for the Restart

Isn't this like asking if the reading is buffered or not?

Tom