aboutsummaryrefslogtreecommitdiff
path: root/experiments/pixel-sequence/draw
blob: c26ac278e927bd92d054cd16581020886cb3c815 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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