9 my ($child, $pipe) = @{ shift @pipes };
10 { local ($/) = undef; $_= <$pipe>; }
11 if (m/^WM_NAME: +not found/) {
12 } elsif (m/^WM_NAME\(STRING\) = $/) {
13 } elsif (m/^WM_NAME\(STRING\) = \"(.*)\"$/) {
14 print "$child $1\n" or die $!;
18 $!=0; $pipe->close(); $? and die "$? $! ?";
21 open WI, "LC_ALL=C xwininfo -root -children |" or die $!;
23 next unless m/^\s+\d+ children:/..0;
24 next unless m/^\s+(0x[0-9a-f]+) /;
27 my $pipe= new IO::File "LC_ALL=C xprop -id $child WM_NAME |" or die $!;
28 push @pipes, [ $child, $pipe ];
30 while (@pipes > 40) { reap_pipe(); }
32 $!=0; close WI; $? and die "$? $! ?";
34 while (@pipes) { reap_pipe(); }
36 close STDOUT or die $!;