aboutsummaryrefslogtreecommitdiff
path: root/contrib/random-correct-layout.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/random-correct-layout.sh')
-rwxr-xr-xcontrib/random-correct-layout.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/random-correct-layout.sh b/contrib/random-correct-layout.sh
new file mode 100755
index 0000000..cf663a1
--- /dev/null
+++ b/contrib/random-correct-layout.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+# Randomized Layout for debug purposes.
+
+CLIENTS="$1"
+OUTPUT_WIDTH="$4"
+OUTPUT_HEIGHT="$5"
+
+for _ in $(seq 1 "$CLIENTS")
+do
+ WIDTH="$(( ( OUTPUT_WIDTH / 5 ) ))"
+ HEIGHT="$(( ( OUTPUT_HEIGHT / 5 ) ))"
+ X="$(( ( RANDOM % ( OUTPUT_WIDTH - WIDTH ) ) + 1 ))"
+ Y="$(( ( RANDOM % ( OUTPUT_HEIGHT - HEIGHT ) ) + 1 ))"
+ echo "$X $Y $WIDTH $HEIGHT"
+done
+