Re: FVWM: FvwmPerl Preprocessing

2013-05-09 Thread mimosinnet
El dimarts, 07 de maig del 2013 a les 15:55, Thomas Adam va escriure:

 On 7 May 2013 13:35, mimosinnet mimosin...@gmail.com wrote:
  [FVWM][__execute_function]: ERROR No such command '%{'
 
  This has been discussed in the list:
 
  http://www.mail-archive.com/fvwm@lists.math.uh.edu/msg09164.html
 
  But I am not clear on what is the right configuration.
 
 We need to see your config file before any of this makes sense.

Thanks for the message. Just for testing it, I have just created this
configuration file..., 

~/.fvwm/config.pl

key i   A C Exec exec xmessage -nearmouse No preprocesing
%{ $b = Preprocessing; $a = key i A S Exec exec xmessage -nearmouse $b; $a 
}%

%{
@a = (KP_Home, KP_Up, KP_Prior, KP_Left, KP_Begin, KP_Right, 
KP_End, KP_Down, KP_Next );
$i = 0;
$b = ;
foreach (@a ) {
$b = $b . Key $_ A N  Exec exec xmessage -nearmouse $i \n;
$i = $i +1;
}
$b
}%


Executed with:

eval 'fvwm -c Module FvwmPerl --preprocess /home/mimosinnet/.fvwm/config.pl'

And it works! :-D :-)

Thanks! You pointed to the right direction. I was directly making
changes in my huge fvwm configuration instead of trying to find a
test. 

I am a happy bunny with a new toy to play with. 

Cheers!

-- 
Mimosinnet
Linux User: #463211
41:24:51N (41.4141) 2:11:24E (2.1902)

Ningún Lugar
Activisme Cultural per a la Transformació Social
http://generatech.org/ningunlugar

Fractalitats en Investigació Crítica
Investigació Crítica per a la Transformació Social
http://psicologiasocial.uab.es/fic



pgpswsaEReCfQ.pgp
Description: PGP signature


Re: FVWM: FvwmPerl Preprocessing

2013-05-09 Thread mimosinnet
El dijous, 09 de maig del 2013 a les 14:53, Thomas Adam va escriure:

 On 9 May 2013 14:40, mimosinnet mimosin...@gmail.com wrote:

code

 I appreciate this is likely in the examples, but the use of @a/@b and
 $a/$b should be discouraged because these are special variables in
 perl which are used for block-level commands like sort/map/grep.
 Also, see the use of qw here for your @a array, above.
 
  $i = 0;
  $b = ;
  foreach (@a ) {
  $b = $b . Key $_ A N  Exec exec xmessage -nearmouse $i \n;
  $i = $i +1;
  }
  $b
 
 You can get the same effect by doing:
 
 $i = 0; $foo = join (\n, map { Key $_ A N Exec exec foo -nearmouse
  . $i++ } @a );
 $foo

Looks like there is still lots to learn! I will get acquainted with the
map and join. Meanwhile, I have updated the information in the fvwm
forums:

- http://www.fvwmforums.org/phpBB3/viewtopic.php?f=33t=2970p=14185#p14185 
- And mentioned in the awesome wiki about the possibilities of Perl
  preprocessing: 
  
http://awesome.naquadah.org/wiki/Keybindings_and_numeric_pad#Having_all_together_in_few_lines_of_code.21.21

Thanks!

-- 
Mimosinnet
Linux User: #463211
41:24:51N (41.4141) 2:11:24E (2.1902)

Ningún Lugar
Activisme Cultural per a la Transformació Social
http://generatech.org/ningunlugar

Fractalitats en Investigació Crítica
Investigació Crítica per a la Transformació Social
http://psicologiasocial.uab.es/fic



pgpzUbhpzn23L.pgp
Description: PGP signature


Re: FVWM: FvwmPerl preprocessing

2003-09-14 Thread Mikhael Goikhman
On 13 Sep 2003 22:02:36 -0300, [EMAIL PROTECTED] wrote:
 
 On Sun, Sep 14, 2003 at 03:06:15AM +0300, Mikhael Goikhman wrote:
  On 13 Sep 2003 20:41:57 -0300, [EMAIL PROTECTED] wrote:
   ==
   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 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.

  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

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

  Use ModuleSynchronous, not Module command as suggested in the man page.
 
 Using ModuleSynchronous now:
 
 AddToFunc StartFunction
 + 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.
--
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 PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Re: FVWM: FvwmPerl preprocessing

2003-09-13 Thread romildo
I forget to tell I am running Fvwm 2.5.7 on Gentoo Linux.

On Sat, Sep 13, 2003 at 08:41:57PM -0300, [EMAIL PROTECTED] wrote:
 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.
-- 
Prof. José Romildo Malaquias[EMAIL PROTECTED]
Departamento de Computação   [EMAIL PROTECTED]
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 PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Re: FVWM: FvwmPerl preprocessing

2003-09-13 Thread Mikhael Goikhman
On 13 Sep 2003 20:41:57 -0300, [EMAIL PROTECTED] wrote:
 
 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.

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

Regards,
Mikhael.
--
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 PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]


Re: FVWM: FvwmPerl preprocessing

2003-09-13 Thread romildo
On Sun, Sep 14, 2003 at 03:06:15AM +0300, Mikhael Goikhman wrote:
 On 13 Sep 2003 20:41:57 -0300, [EMAIL PROTECTED] wrote:
  ==
  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 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

--
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 PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]