From 3cb75416a99cd9443f8e286e020d3e6b2af6c0ca Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sun, 13 Feb 2022 11:21:16 +0100 Subject: [PATCH] Sample script fixes and tweaks --- sample-scripts/bouncingball.pl | 14 +++++++++----- sample-scripts/lcdmover.sh | 10 ++-------- sample-scripts/testroller.pl | 13 +++++-------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/sample-scripts/bouncingball.pl b/sample-scripts/bouncingball.pl index 937a89b7..7a0e7021 100755 --- a/sample-scripts/bouncingball.pl +++ b/sample-scripts/bouncingball.pl @@ -58,19 +58,22 @@ open IPCPIPE,"| eesh"; $i = 0; foreach (@fallspeed) { $originalbally = $bally; - $fallspeed = $fallspeed[i]; + $fallspeed = $fallspeed[$i]; +# print "loop $i x,y $ballx,$bally fall $fallspeed\n"; while ($bally < ($height - $ballh)) { if (($bally + $fallspeed + $ballh) < $height) { $bally += $fallspeed; } else { $bally = $height - $ballh; } +# print "win_op $ball move $ballx $bally\n"; print IPCPIPE "win_op $ball move $ballx $bally\n"; - system("usleep 20000"); + system("sleep .020"); } - if ($fallspeed[i+1]) { - $fallspeed = $fallspeed[i+1]; +# print "reverse\n"; + if ($fallspeed[$i + 1]) { + $fallspeed = $fallspeed[$i + 1]; } else { $fallspeed = 1; } @@ -82,8 +85,9 @@ foreach (@fallspeed) { } else { $bally = $originalbally + int($originalbally * (1/$#fallspeed)); } +# print "win_op $ball move $ballx $bally\n"; print IPCPIPE "win_op $ball move $ballx $bally\n"; - system("usleep 20000"); + system("sleep .020"); } $i++; } diff --git a/sample-scripts/lcdmover.sh b/sample-scripts/lcdmover.sh index cfca9212..8bafc593 100755 --- a/sample-scripts/lcdmover.sh +++ b/sample-scripts/lcdmover.sh @@ -26,16 +26,10 @@ # # Open dialog 1 -eesh -e "dialog_ok Move this window" -usleep 100000 -eesh -e "wop Message title Dlg1" -usleep 100000 +eesh -e "dialog_ok [Dlg1] Move this window" # Open dialog 2 -eesh -e "dialog_ok Watch me follow the above window" -usleep 100000 -eesh -e "wop Message title Dlg2" -usleep 100000 +eesh -e "dialog_ok [Dlg2] Watch me follow the above window" # In one endless loop, get window position of the first window, then move the # second one accordingly... diff --git a/sample-scripts/testroller.pl b/sample-scripts/testroller.pl index 76660be3..7ff88c6f 100755 --- a/sample-scripts/testroller.pl +++ b/sample-scripts/testroller.pl @@ -34,9 +34,9 @@ # the window. if ($ARGV[0] eq "on") { - $shade = 1; + $shade = "on"; } else { - $shade = 0; + $shade = "off"; } # here we'll retreive the current desk we're on @@ -78,16 +78,13 @@ foreach (@winlist) { $area = $3; $name = $4; -# Skip pagers, iconboxes, systrays, and epplets + # Skip pagers, iconboxes, systrays, and epplets next if ($name =~ /^Pager-|Iconbox|Systray|E-/); # next unless (($desk == -1) and ($desk eq $current_desk)); next unless ($desk eq $current_desk); next unless ($area eq $current_area); - if ($shade) { - print IPCPIPE "win_op $window shade on\n"; - } else { - print IPCPIPE "win_op $window shade off\n"; - } +# print "win_op $window shade $shade\n"; + print IPCPIPE "win_op $window shade $shade\n"; } }