Re: FVWM: Argument Passing?

From: Dan Espen <dane_at_mk.telcordia.com>
Date: Fri, 14 Jan 2000 16:14:05 -0500

jtl_at_cs.man.ac.uk writes:
> > From owner-fvwm_at_hpc.uh.edu Fri Jan 14 20:38:13 2000
>
> > > AddToFunc SwitchDecor
> > > + "I" Exec echo $0 > HOME/USER_WM_STYLE
> > > + "I" Restart HOME/bin/RunWM
> > >
> > > I believe the Exec is guaranteed to finish before the Restart begins (can
> > > anyone confirm this?).
> >
> > >From the man page:
> >
> > Note that this function doesn't wait for command to
> > complete, so things like:
> >
> > Exec "echo AddToMenu ... > /tmp/file"
> > Read /tmp/file
> >
> > won't work reliably.
>
> True, but I've found that a Restart *appears* to wait for current Exec's to
> finish. Thinking more about it, perhaps I was just being lucky!! Is a Restart
> treated differently in this respect to any other fvwm2 command?

Once you do an Exec, the actual execution is controlled by the OS.

I'm not surprised that this "mostly" works. A typical echo would
normally complete long before fvwm got around to reading its config
files.

> 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
>
> Or even:
>
> AddToFunc SwitchDecor
> + "I" PipeRead "echo $0 > HOME/USER_WM_STYLE; echo Restart HOME/bin/
> RunWM"
>
> (which now suggests one doesn't even need the function SwitchDecor, although
> perhaps it's nicer than having the PipeRead repeated for each menu item).

Both of these look like winners to me.

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: dane_at_mk.telcordia.com
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
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 Jan 14 2000 - 15:18:48 GMT

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