Ok, here is the promissed module in Perl that demonstrates one more
solution for storing window positions/names/whatever. This module
requires the latest fvwm from cvs. Save this file as FvwmWindowDance and
call it using the full path with an optional Module keyword. The code
hopefully explains itself.
#!/usr/bin/perl -w
use lib `fvwm-perllib dir`;
use FVWM::Module;
my $module = new FVWM::Module;
my $tracker = $module->track("WindowList");
foreach my $window ($tracker->windows) {
my $x = $window->{x};
my $y = $window->{y};
my $name = $window->{visible_name};
next unless $window->match("CurrentPage, !Iconified");
$module->send("Move ${y}p ${x}p", $window->{id});
sleep(1);
$module->send("Move ${x}p ${y}p", $window->{id});
sleep(1);
}
$module->disconnect;
Note 1. "AnimatedMove" instead of "Move" does not work well here,
supposedly because of the general fvwm problem with grabbing+AnimatedMove.
Note 2. Unfortunately there are no many window conditions right now
besides the "CurrentDesk", "Iconified". For example "Sticky" and other
flags are definitely missing.
Note 3. This is a transient module, but a long-lived module with event
loop is possible and would be preferable in some cases. All window
information is automatically up to date in this case, it all should be
handled by the WindowList tracker behind the scenes. "fvwm-perllib man".
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 majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Tue Jun 29 2004 - 17:59:02 BST