#!/bin/bash

# XXX
# This script assumes Z is at 20 as set after bed level
set -x

OCTOSCRIPT=/usr/local/bin/octoscript

# Need to wait for print to end
# If octoprint doesn't appear to be running, poll for 30 seconds
STATE=`$OCTOSCRIPT operation`
i=0
  while [ $STATE == "Printing" ] ; do echo -e "\nStill printing..." ;
  sleep 1
  STATE=`$OCTOSCRIPT operation`
done

octoscript home xy

sleep 3

octoscript jog 0 150 0

qiv --readonly --no_statusbar  --fullscreen --cycle ~/Pictures/apply_glue.png

octoscript home xy

sleep 3

octoscript jog 75 75 0

sleep 3
