FVWM: Argument Passing?

From: Thomas A. Gardiner <gardiner_at_pas.rochester.edu>
Date: Fri, 14 Jan 2000 19:16:56 -0500 (EST)

Hi,

Sorry for not responding to this earlier. John, I'm especially sorry for
not trying your suggestion yet. So, I get varied results...

The first suggestion.

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

I tried the first suggestion below, and it works for me, but I too was
afraid that it would be unreliable from the excerpt of the fvwm2 man page
which Dan mentioned.

>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.



>> 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...

The third suggestion gives me an error for some unknown reason.

>> Or even:
>>
>> 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...

>> (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).

Now one last demonstration of my ignorance.

What does this mean?

       PipeRead cmd option
              Causes fvwm to read commands output from the pro-
              gram named cmd. Useful for building up dynamic
              menu entries based on a directories contents, for
              example.

So this caused fvwm2 to read the result of the echo command and do nothing
with it?

PipeRead "echo $0 > HOME/USER_WM_STYLE"

Tom

--
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 - 18:19:39 GMT

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