kwo pushed a commit to branch master.

http://git.enlightenment.org/e16/e16.git/commit/?id=95a41f07a23c2ecd00b8d1fa83a7ce299ac6e1b8

commit 95a41f07a23c2ecd00b8d1fa83a7ce299ac6e1b8
Author: Kim Woelders <[email protected]>
Date:   Fri Apr 22 16:31:31 2022 +0200

    place-pagers.pl: Behave properly when pagers have borders
---
 sample-scripts/place-pagers.pl | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/sample-scripts/place-pagers.pl b/sample-scripts/place-pagers.pl
index a0adcc0c..9083bef7 100755
--- a/sample-scripts/place-pagers.pl
+++ b/sample-scripts/place-pagers.pl
@@ -14,7 +14,7 @@ my $BASE     =     0;
 my $VERBOSE  =     0;
 my $LAYER    =     4;
 
-my (%ID, $X0, $Y0, $H, $W, @DNUMs);
+my (%ID, $X0, $Y0, $W0, $H0, $W, $H, @DNUMs);
 my $last_dnum = -1;
 
 GetOptions(
@@ -67,16 +67,15 @@ $ORIENT =~ m/^[vVhH]\d*$/ or do {
 
 $ORIENT =~ s/(\d+)// and $BASE = $1;
 
-for my $wind (`eesh wl full`) {
-    my ($id, $name, undef, undef, undef, $geo) = split(/\s*:\s*/, $wind);
-    chomp $id;
-    $name =~ /^Pager-(\d)$/ or next;
-    #print "$id, $name, $geo\;
-    my $dnum = $1;
+for (`eesh wl +%i_%P_%S_%T_%n`) {
+#   print "> $_";
+    next unless 
(/^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)x\s*(\S+)\s+(\S+)x\s*(\S+)\s+Pager-(\d+)/);
+    my $id = $1;
+    my $dnum = $8;
+#   print "$id, $dnum\n";
 
     defined $KEY or $KEY = $dnum;
 
-    $id =~ s/\s+$//;
     $ID{$dnum} = $id;
     push @DNUMs, $dnum;
     if ( $KEY < 0 ) {
@@ -85,12 +84,10 @@ for my $wind (`eesh wl full`) {
     else {
         $dnum == $KEY or next;
     }
-
     $last_dnum = $dnum;
 
-    ($X0, $Y0, my $size, undef) = split( /\s+/, $geo);
-    ($W, $H) = split( /x/, $size);
-    #print "$dnum, $id, $X0, $Y0, $W, $H\n";
+    ($X0, $Y0, $W0, $H0, $W, $H) = ($2, $3, $4, $5, $6, $7);
+#   print "$dnum, $id, $X0, $Y0, $W0, $H0, $W, $H\n";
 }
 
 @DNUMs      or die "No pagers found in window list! (eesh wl full)\n";
@@ -130,8 +127,8 @@ for my $dnum (sort {$a <=> $b} @DNUMs) {
 
     #$dnum == $KEY and next;
 
-    $x = $X0 + $mod_x * ($W + $BORDER);
-    $y = $Y0 + $mod_y * ($H + $BORDER);
+    $x = $X0 + $mod_x * ($W0 + $BORDER);
+    $y = $Y0 + $mod_y * ($H0 + $BORDER);
     system("eesh wop $id size $W");
     system("eesh wop $id move $x $y");
     system("eesh wop $id layer $LAYER");

-- 


Reply via email to