aboutsummaryrefslogtreecommitdiff
path: root/experiments/pixel-sequence
diff options
context:
space:
mode:
Diffstat (limited to 'experiments/pixel-sequence')
-rwxr-xr-xexperiments/pixel-sequence/draw31
1 files changed, 31 insertions, 0 deletions
diff --git a/experiments/pixel-sequence/draw b/experiments/pixel-sequence/draw
new file mode 100755
index 0000000..c26ac27
--- /dev/null
+++ b/experiments/pixel-sequence/draw
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# pray that the mouse is in the edit field once this timer runs out
+sleep 3
+
+pattern='
+1010
+11001100
+1111000011110000
+11111111000000001111111100000000
+'
+pattern="$(echo "$pattern" | tr -d '\n' | sed 's/./\0 /g')"
+
+for pixel in $pattern ; do
+ # shift mouse 1 pixel right
+ xdotool mousemove_relative 1 0
+
+ # skip 0's in $pattern
+ [ $pixel -ne 1 ] && continue
+
+ # drag mouse 1px down to create pixel
+ xdotool mousedown 1
+ sleep 0.05
+ xdotool mousemove_relative 0 5
+ sleep 0.05
+ xdotool mouseup 1
+ sleep 0.05
+ xdotool mousemove_relative 0 -5
+ sleep 0.05
+done
+