From 789226bf5a815a04494a7fa5b6f4fbace73f3d70 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 12 Jan 2019 00:29:36 +0800 Subject: astro/ds9saveimg.sh: Tweak delays to be more robust (2) --- astro/ds9saveimg.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/astro/ds9saveimg.sh b/astro/ds9saveimg.sh index a83a80a..2b6787c 100755 --- a/astro/ds9saveimg.sh +++ b/astro/ds9saveimg.sh @@ -40,9 +40,14 @@ while [ ${retry} -ne 0 ]; do retry=$? done -# Bring the window to the front and snapshot to an image file -wmctrl -a ${TITLE} -xpaset -p ${TITLE} saveimage png ${IMG} +retry=1 +while [ ${retry} -ne 0 ]; do + # Bring the window to the front and snapshot to an image file + wmctrl -a ${TITLE} && + xpaset -p ${TITLE} saveimage png ${IMG} + retry=$? + [ ${retry} -ne 0 ] && sleep 1 +done echo "${TITLE}: ${FITS} + ${REG} => ${IMG}" #echo 'paused ...' && read _ -- cgit v1.2.2