Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Update teensyduino.sh PID Detection
#!/bin/bash
sleep 2
export HOME=$2
$1 & TEENSYPID=$!
sleep 5
xdotool search --class "teensyduino" \
windowfocus \
key space sleep 1 \
key Tab sleep 0.4 \
key Tab sleep 0.4 \
key Tab sleep 0.4 \
key Tab sleep 0.4 \
key space sleep 1 \
key Tab sleep 0.4 \
key Tab sleep 0.4 \
key Tab sleep 0.4 \
key Tab sleep 0.4 \
key space sleep 1 \
key Tab sleep 0.4 \
key space sleep 35
kill $TEENSYPID >/dev/null || exit 1
[ -d $2/hardware/teensy ] || exit 1
--- teensyduino.sh 2018-09-23 07:13:17.000000000 -0400
+++ teensyduino_pid.sh 2018-12-11 02:33:20.774271251 -0500
@@ -3,7 +3,7 @@
sleep 2
export HOME=$2
-$1 &
+$1 & TEENSYPID=$!
sleep 5
xdotool search --class "teensyduino" \
@@ -22,5 +22,5 @@
key Tab sleep 0.4 \
key space sleep 35
-killall $(basename $1) >/dev/null || exit 1
+kill $TEENSYPID >/dev/null || exit 1
[ -d $2/hardware/teensy ] || exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.