Subject: FVWM: Fvwm Function Parameters

From: Maxwell Spangler <[email-masked]>
Date: Thu, 21 May 1998 16:46:07 -0400 (EDT)

I'm trying to add general functions to my .fvwm2rc file to handle
different variations of the same task--starting remote xterms on local,
networked machines.

Instead of lots of lines of:

rsh -n -l maxwell dellpro "/usr/bin/X11/xterm -display maxwax:0.0"

I want to do:

AddToFunc RemoteShell
+ "I" Exec rsh -n -l $1 $2 "/usr/bin/X11/xterm -display $3"

$1 = user to login on remote as
$2 = remote host system name
$3 = name of X display SERVER to which output of xterm will be placed.

Then, I could make menus with:

AddToMenu MyMenu
+ "Remote on toronto" RemoteShell maxwell toronto "maxwax:0.0"
+ "Remote on dellpro" RemoteShell mstar   dellpro "maxwax:0.0"

etc.

This isn't working at all, and I haven't been able to find examples of
calling functions with numbered parameters.. Anybody else doing this?
Anybody want to make an attempt to get it working and show me how its
done?

Thanks!

Maxwell Spangler, Software Developer, Greenbelt, Maryland, USA

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: "Jos\i Manuel Sousa Pereira" <[email-masked]>
Date: Fri, 22 May 1998 00:03:09 +0100 (WEST)

"MS" == Maxwell Spangler <[email-masked]> writes:

  MS> I want to do:

  MS> AddToFunc RemoteShell + "I" Exec rsh -n -l $1 $2 "/usr/bin/X11/xterm
  MS> -display $3"

  MS> $1 = user to login on remote as $2 = remote host system name $3 = name
  MS> of X display SERVER to which output of xterm will be placed.
...
  MS> This isn't working at all, and I haven't been able to find examples of
  MS> calling functions with numbered parameters.. Anybody else doing this?
  MS> Anybody want to make an attempt to get it working and show me how its
  MS> done?

>From the manual:
 
          The special symbols $w and $0 through $9 are  available
          in the ComplexFunctions or Macros, or whatever you want
          to call them. Within a macro, $w  is  expanded  to  the
          window-id (expressed in hex, ie 0x10023c) of the window
          for which the macro was called. $0 though  $9  are  the
          arguments to the macro, so if you call
(useful example follows!!!)

So, change it to:

AddToFunc RemoteShell 
+ "I" Exec rsh -n -l $0 $1 "/usr/bin/X11/xterm -display $2"

It works.

"man fvwm2" is a quite useful reading for the fvwm2 user ;-)

Happy reading,
-- 
 Jose' Pereira				 		Tel. +351.1.841 9340
 DEEC - Dep. of Electrical and Computer Engineering	Fax. +351.1.841 7499
 Instituto Superior Tecnico - Technical University of Lisboa
 Av. Rovisco Pais - 1096 Lisboa Codex - Portugal
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
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: Maxwell Spangler <[email-masked]>
Date: Thu, 21 May 1998 21:16:51 -0400 (EDT)

> + "I" Exec rsh -n -l $0 $1 "/usr/bin/X11/xterm -display $2"

Duhhhhhh, my error. I forgotten that unlike some shells, Fvwm has $0 for
the first parameter, not $1. OOPS.

> "man fvwm2" is a quite useful reading for the fvwm2 user ;-)

Oh, I read it, hence, that's why I was able to ask the question.  Just a
class programming overlook error.

Works fine now, thanks Josi.