Subject: FVWM: FvwmPerl preprocessing

From: [email-masked]
Date: Sat, 13 Sep 2003 20:41:57 -0300

Hello.

I am looking for a way of doing arithmetic in the configuration
file of Fvwm, in order to position windows in the task bar I am
trying to setup.

Searching old messages, I have found an indication that the
FvwmPerl module could do what I want. It had been suggested to do
put the following in the configuration file:

==========================================================
AddToFunc StartFunction
+ I Module FvwmPerl

DestroyFunc .
AddToFunc .
+ I SendToModule FvwmPerl preprocess -c -- $*
==========================================================

The . function would preprocess its argument prior
to delivering it to Fvwm.

When I try the following

. Echo %{ $[vp.width] - 100 }%

in FvwmConsolde, it does work and I get 

[FVWM][Echo]: 1300

as the output.

But if I put that command in my configuration file, it
does not work when I restart Fvwm.

Any clues?

Romildo
-- 
Prof. José Romildo Malaquias        [email-masked]
Departamento de Computação       [email-masked]
Univ. Federal de Ouro Preto  http://uber.com.br/romildo
--
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: [email-masked]
Date: Sat, 13 Sep 2003 20:58:22 -0300

I forget to tell I am running Fvwm 2.5.7 on Gentoo Linux.

---

From: Mikhael Goikhman <[email-masked]>
Date: Sun, 14 Sep 2003 03:06:15 +0300

> put the following in the configuration file:

Make sure FvwmPerl is running when you use "." function.
Use ModuleSynchronous, not Module command as suggested in the man page.

Regards,
Mikhael.

---

From: [email-masked]
Date: Sat, 13 Sep 2003 22:02:36 -0300

> On 13 Sep 2003 20:41:57 -0300, [email-masked] wrote:

Any explanation for this behaviour (works in FvwmConsole only)?

> Make sure FvwmPerl is running when you use "." function.

FvwmPerl is running:

$ ps x | grep FvwmPerl
25356 vc/1     S      0:00 /usr/bin/perl -w /usr/lib/fvwm/2.5.7/FvwmPerl 7 4 none 0 8

> Use ModuleSynchronous, not Module command as suggested in the man page.

Using ModuleSynchronous now:

AddToFunc StartFunction
+ I ModuleSynchronous FvwmPerl

Romildo

---

From: Mikhael Goikhman <[email-masked]>
Date: Sun, 14 Sep 2003 09:24:48 +0300

> Any explanation for this behaviour (works in FvwmConsole only)?

When you run it in FvwmConsole, FvwmPerl is already running,
when you use "." function in .fvwm2rc, it is not yet.

> 25356 vc/1     S      0:00 /usr/bin/perl -w /usr/lib/fvwm/2.5.7/FvwmPerl 7 4 none 0 8

It's running when you issue "ps", but not when you SendToModule.
Bad timing or command order.

> + I ModuleSynchronous FvwmPerl

You may use SendToModule in StartFunction or InitFunction. If you want to
use in in the top level, i.e. before StartFunction is even callled, then
you should have "ModuleSynchronous FvwmPerl" as the first command in
your .fvwm2rc.

Nothing FvwmPerl specific, any module with SendToModule would behave
similarly.

Regards,
Mikhael.