aboutsummaryrefslogtreecommitdiff
path: root/experiments/draw/lib.sh
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-05-02 16:58:35 +0200
committerlonkaars <loek@pipeframe.xyz>2024-05-02 16:58:35 +0200
commit1634d546d3e941701fdbab211dfa376f334339f1 (patch)
tree16aaba7f0d0b529fb6793809e1c05b87770c9b87 /experiments/draw/lib.sh
parent7c402c347b46f908eefefb6a957bf92100061951 (diff)
WIP messy pictochat protocol dissector
Diffstat (limited to 'experiments/draw/lib.sh')
-rw-r--r--experiments/draw/lib.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/experiments/draw/lib.sh b/experiments/draw/lib.sh
new file mode 100644
index 0000000..90e5689
--- /dev/null
+++ b/experiments/draw/lib.sh
@@ -0,0 +1,48 @@
+WINDOW="$(xdotool search --onlyvisible --maxdepth 2 --class melonDS | head -n1)"
+[ -z "$WINDOW" ] && exit 1
+
+eval "$(xdotool getwindowgeometry --shell "$WINDOW")"
+
+sleep 0.5
+
+bottom_screen() {
+ xdotool mousemove $X $Y
+ # skip menu bar
+ xdotool mousemove_relative 0 20
+ # skip top screen
+ xdotool mousemove_relative 0 192
+
+ xdotool mousemove_relative -- $1 $2
+}
+
+tap() {
+ xdotool mousedown 1
+ sleep 0.02
+ xdotool mouseup 1
+ sleep 0.02
+}
+
+eraser() {
+ bottom_screen 8 60
+ tap
+}
+
+pen() {
+ bottom_screen 8 44
+ tap
+}
+
+small() {
+ bottom_screen 8 92
+ tap
+}
+
+big() {
+ bottom_screen 8 76
+ tap
+}
+
+msg_clear() {
+ bottom_screen 240 170
+ tap
+}