Subject: FVWM: Argument Passing?

From: "Thomas A. Gardiner" <[email-masked]>
Date: Thu, 13 Jan 2000 10:47:01 -0500 (EST)

Say, is it still the case that fvwm2 is incapable of passing arguments to
scripts?

Tom

_________________________________________________________________________
Thomas Gardiner
[email-masked]

University of Rochester
Department of Physics and Astronomy
P. O. Box 270171
Rochester, NY 14627-0171

(716) 275-9625 Office 2
(716) 275-0537 Office 1
(716) 275-8527 fax
__________________________________________________________________________

The scientist does not study nature because it is useful; he studies it
because he delights in it, and he delights in it because it is beautiful.
If nature were not beautiful, it would not be worth knowing, and if nature
were not worth knowing, life would not be worth living.- Henri Poincare
__________________________________________________________________________

--
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: Fri, 14 Jan 2000 11:21:37 -0500 (EST)

I guess I should interpret the silence on this as a resounding yes?

Sorry if I hit a sore spot or something...
Tom

---

From: Dan Espen <[email-masked]>
Date: Fri, 14 Jan 2000 11:53:23 -0500

> >Say, is it still the case that fvwm2 is incapable of passing arguments to

I'm thinking too.

I have yet to figure out what your asking about.

Is this in reference to scripts launched by the Exec command,
or FvwmScript, or some other kind of script?

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
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 [email-masked].
To report problems, send mail to [email-masked].

---

From: Fuzzy Fox <[email-masked]>
Date: Fri, 14 Jan 2000 11:15:37 -0600

> I guess I should interpret the silence on this as a resounding yes?

Probably it indicates that nobody understood your question.

> > Say, is it still the case that fvwm2 is incapable of passing
> > arguments to scripts?

What sort of arguments?  In what situation?  An example would help
clarify the question.

-- 
   [email-masked] (Fuzzy Fox)     || "Good judgment comes from experience.
sometimes known as David DeSimone  ||  Experience comes from bad judgment."
  http://www.dallas.net/~fox/      ||                 -- Life Lessons
--
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: Fri, 14 Jan 2000 12:25:58 -0500 (EST)

>or FvwmScript, or some other kind of script?

I have a script in my $HOME/bin/ directory which I execute from my
.xsession with a command something like

exec $HOME/bin/RunWM --FvwmFoo

This is essentially a reworked version of the RunWM script used by RedHat
to start the window manager from xdm.  The argument FvwmFoo causes fvwm2
to be started with the FvwmFoo decor.

In order to switch decor to FvwmBar the AnotherLevel package does a
restart calling the script RunWM.FvwmBar which is a symbolic link to
RunWM.  The script RunWM then checks to see how it was called or if it was
called by the name RunWM.FvwmBar or RunWM.Foo or what have you and chooses
the appropriate decor.

The annoying part is that every time I want to add another decor I have to
create another symbolic link, edit the RunWM script, as well as a few
other routines.  

There are two simple ways to get around this.

1) Pass an argument to the script.

2) Have two commands executed in sequence from a single menu selection
which essentially will do 

echo FvwmBar > $HOME/.wm_style 
exec RunWM

This is not the preferred alternative though since the RunWM script will
end up doing 

cat $HOME/.wm_style

meaning that the two commands need to be executed in order.

Tom

---

From: Dan Espen <[email-masked]>
Date: Fri, 14 Jan 2000 12:45:09 -0500

> exec $HOME/bin/RunWM --FvwmFoo

Does the "-cmd" or "-f" argument to fvwm help?  (First read the theme file,
have the theme file read the .fvwm2rc.)

Or you could export an environment variable and use it in a Read command.

---

From: "Thomas A. Gardiner" <[email-masked]>
Date: Fri, 14 Jan 2000 13:44:17 -0500 (EST)

Hi,

>Or you could export an environment variable and use it in a Read command.

I'm afraid I don't see how I could easily make use of these commands to
get the behavior I want.  The .fvwm2rc file is constructed with m4
preprocessing and the decor or theme is included at that level. Since
some of the style commands are order specific it could be a real
programming chore to extract out the decor which is mostly localized, but
has fingers into other parts...

Essentially for the m4 package to work I need to have the name of the
desired decor in the file $HOME/.wm_style.  The question is how to get the
name there.  Either pass it to a script which echo's it to the file and
does the restart or put it there and then do the restart from fvwm2 (in
that order).

>Or you could export an environment variable and use it in a Read command.

This looks like it should work but again the menu item chosen would need
to do two things, set an environment variable and restart fvwm.  If I
could make this work I couls also make other things work.

For example, in bash (and most other shells ) I can do composite commands
like cd /foo/bar ; echo hi > there ; cat there

Is it possible to use the Restart function to do this

Restart echo FvwmFoo > $HOME/.wm_style ; exec $HOME/RunWM

This would be ideal.

Tom

---

From: Brad Giaccio <[email-masked]>
Date: Mon, 17 Jan 2000 06:31:41 -0500

Tom, 

This seemed to simple since it sounds like you know your way around your
rc file but could you do something like

AddToFunction MyRestart
+ "I" echo $1
+ "I" Restart $HOME/RunWM

AddToMenu RestartMenu
+ "I" MyRestart FvwmFoo
+ "I" MyRestart FvwmBar

That would call a function that could do both.  

Brad

-- 
--- There are two kinds of knowledge, you either know the answer or
			you know where to find it
		      -Kane, Johnson, and anonymous
--
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: Mon, 17 Jan 2000 08:48:13 -0500 (EST)

Brad,

Thanks for the suggestions.  Variants of this were proposed by John Latham 
and Dan Espen. (Many thanks again!)  What you call MyRestart they called
SwitchDecor and the suggestions were

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

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

, the PipeRead guaranteeing the order of execution.  Both word great. 
Quite honestly I guess I just don't yet understand the fvwm2 _way_ of
doing things since I'm learning by basicaly hacking on the AnotherLevel
package which appears to  be a bit out of date (eg. not a single PipeRead
statement exists in the version of AnotherLevel I'm using!).  Well, all in
due time...

Thanks,
Tom