Subject: FVWM: FVWM modules

From: Rasmus Stenfalk <[email-masked]>
Date: Wed, 14 Aug 2002 15:08:49 +0200

Hi

Anyone know where I can find toturials on writing FVWM modules? I'd like to 
write my own focus module. (A module that switches focus *and* raises windows 
following the mouse pointer)

Sorry if this is a stupid question, but I haven't had the time to check out 
the site yet.

Thanks

/Rasmus Stenfalk

------------------------
OFiR Job er Danmarks største jobdatabase på internettet. Hvis du aktivt søger nye udfordringer i karrieren, så er det på OFiR Job du finder dem. Tøv ikke! Klik her http://dksalg.ofir.dk/rd.asp?ser=11&kam=25&url=http://job.ofir.dk/ og du er godt i gang.

Lad din kommende arbejdsgiver kontakte dig. Indtast et søgbart CV på under 15 min. og giv interesserede arbejdsgivere mulighed for at kontakte DIG. Tøv ikke! Opret dit CV her http://dksalg.ofir.dk/rd.asp?ser=11&kam=26&url=http://jobcv.ofir.dk/ og lad jobbet komme til dig…
------------------------

--
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: Dan Espen <[email-masked]>
Date: Wed, 14 Aug 2002 09:24:32 -0400

> Sorry if this is a stupid question, but I haven't had the time to check out 

The module interface is documented at http://www.fvwm.org.
Pick "Developer Info (CVS, Modules)", then "Module Developer Info".

In the development branch, there have just been extensive changes
made to the focus code.

-- 
Dan Espen                           E-mail: [email-masked]
444 Hoes Lane  Room RRC 1C-214      Phone: (732) 699-5570
Piscataway, NJ 08854
--
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: Mikhael Goikhman <[email-masked]>
Date: Wed, 14 Aug 2002 13:39:56 +0000

On 14 Aug 2002 15:08:49 +0200, Rasmus Stenfalk wrote:
> 
> Anyone know where I can find toturials on writing FVWM modules?

See the developer documentation at fvwm.org.
If you use 2.5.2+ run "fvwm-perllib man" for documentation on creating
modules in perl.

> I'd like to write my own focus module. (A module that switches focus
> *and* raises windows following the mouse pointer)

I think you need FvwmAuto if you use SloppyFocus/MouseFocus.

Or if you use ClickToFocus and want an autoraising when clicking on a
window to gain a focus there are corresponding style options.

On the other hand writing a small focus module should be not harder than
10 lines of perl. Here is a small FvwmAuto replacement:

	#!/usr/bin/perl -w
	use lib `fvwm-perllib dir`;
	use FVWM::Module;

	my $module = new FVWM::Module(Mask => M_FOCUS_CHANGE);
	$module->addHandler(M_FOCUS_CHANGE, sub {
		my ($self, $type, $winId) = @_;
		$self->send("Raise", $winId);
	});
	$module->eventLoop;

> Sorry if this is a stupid question, but I haven't had the time to check out 

Regards,
Mikhael.

---

From: Perry Hutchison <[email-masked]>
Date: Wed, 14 Aug 2002 08:40:17 -0700 (PDT)

> ... writing a small focus module should be not harder than
> 10 lines of perl ...

Of course, using a small-footprint window manager like FVWM to
launch a Perl script is a bit like using a firecracker to set
off an H-bomb :)
--
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: Mikhael Goikhman <[email-masked]>
Date: Wed, 14 Aug 2002 16:09:55 +0000

> launch a Perl script is a bit like using a firecracker to set

Any FVWM module usually is event based and sleeps all the time.
An FVWM module written in perl may consume less memory then FvwmPager.

So I don't see your point. Probably I just don't understand a slang. :)

Regards,
Mikhael.

---

From: Perry Hutchison <[email-masked]>
Date: Wed, 14 Aug 2002 09:20:42 -0700 (PDT)

> So I don't see your point. Probably I just don't understand a slang. :)

Point is, Perl is *huge* (last I heard).  If most of the size is
in the text segment, and some Perl process is already running, it's
possible that the incremental size of an additional process is not
all that big.
--
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: Mikhael Goikhman <[email-masked]>
Date: Wed, 14 Aug 2002 16:50:03 +0000

> possible that the incremental size of an additional process is not

I don't know what "huge" means for you. Are xterm or rxvt huge?

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
migo     19860  1.5  0.6  2712 1292 pts/23   S    19:29   0:00 rxvt
migo     19877  3.3  1.1  5840 2240 pts/23   S    19:30   0:00 xterm
migo     19778  0.0  0.4  2444  832 pts/7    S    19:24   0:00 perl

migo     16908  0.0  1.2  4292 2432 tty6     S    13:32   0:02 FvwmPager
migo     16897  0.0  1.4  3924 2768 tty6     S    13:32   0:00 /usr/bin/perl -w .../themes/redmondxp/modules/FvwmThemesPanelManager
migo     19947  0.0  1.2  3464 2296 tty6     S    19:39   0:00 /usr/bin/perl -w .../FvwmAutoReplacementPostedInThisMailThread

Regards,
Mikhael.

---

From: Perry Hutchison <[email-masked]>
Date: Wed, 14 Aug 2002 10:25:28 -0700 (PDT)

> migo     19947  0.0  1.2  3464 2296 tty6     S    19:39   0:00 /usr/bin/perl -w .../FvwmAutoReplacementPostedInThisMailThread

Interesting that there are no shell processes in this list :)

Compared with other script interpreters, I would expect Perl to be
much larger than a Bourne shell, and probably larger than bash.
Perl used to be described as a "Swiss Army chainsaw" on the way to
becoming a "Swiss Army tactical nuke."

I don't have any Perl processes active, but here are some samples
of other stuff (on Red Hat 6.2/i686, FVWM 2.2.4).  Netscape is the
clear winner of the bloat award :)

USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
phutchis  5115  0.0  0.5  2532 1508 ?        S    08:08   0:02 fvwm2
phutchis  5242  6.6  0.5  2392 1328 ?        S    08:08   7:47 xosview -geometry +1383+0
phutchis  5244  0.1  5.5 22428 14392 ?       S    08:08   0:08 /usr/lib/netscape/netscape-communicator -irix-session-management -geometry +0+0
phutchis  5298  0.0  0.8  4284 2168 ?        S    08:08   0:00 xterm
phutchis  5302  0.0  0.3  1628  844 ?        S    08:08   0:00 sh /folk/phutchis/.xsession
phutchis  5327  0.0  0.3  1716 1012 pts/1    S    08:08   0:00 bash
phutchis  5328  0.0  0.3  2120  944 ?        S    08:08   0:00 /usr/X11R6/lib/X11/fvwm2/FvwmPager 8 5 /folk/phutchis/.fvwm2rc 0 8 0 0
phutchis  5434  0.0  1.4  5112 3860 ?        S    08:08   0:03 ical -geometry +450+300

For a comparison involving an actual Bourne shell, this is from
Solaris/sun4u 2.5.1:

USER       PID %CPU %MEM   SZ  RSS TT       S    START  TIME COMMAND
phutchis   879  0.2  1.2 3232 3040 ?        R 08:08:28  0:00 xterm
phutchis   880  0.0  0.5 1496 1296 pts/1    S 08:08:28  0:00 bash
phutchis  1051  0.0  0.4  912  832 pts/1    R 10:14:48  0:00 /bin/sh -c /usr/ucb/ps ugxww
--
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: Dominik Vogt <[email-masked]>
Date: Wed, 14 Aug 2002 19:51:10 +0200

> phutchis  1051  0.0  0.4  912  832 pts/1    R 10:14:48  0:00 /bin/sh -c /usr/ucb/ps ugxww

What's the point in this discussion?  On the average system, the
shell and probably perl too are probably permanently in main
memory.  It's moot to discuss the size of the executable in memory
since it's there anyway.  What counts it the dynamic memory usage,
and that depends on what you do with perl/shell/whatever (and you
won't see it in "top").  memstat gives much better information
about dynamic memory usage.

Bye

Dominik ^_^  ^_^

 --
Dominik Vogt, mail: [email-masked], phone: 0721/91374-382
Schlund + Partner AG, Erbprinzenstr. 4-12, D-76133 Karlsruhe
--
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: Mikhael Goikhman <[email-masked]>
Date: Wed, 14 Aug 2002 18:47:45 +0000

> about dynamic memory usage.

The point is to show that perl can't be called huge any more than bash or
rxvt or fvwm are called huge.

Regards,
Mikhael.