From b4907b82ff6201bf77eeeb7a2b4c04279cd664a7 Mon Sep 17 00:00:00 2001 From: probonopd Date: Sat, 24 Jul 2021 11:42:29 +0200 Subject: [PATCH] Make sure the application gets killed even if the screenshot taking fails --- code/worker.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/worker.sh b/code/worker.sh index 6c59ea11..8f3b454c 100644 --- a/code/worker.sh +++ b/code/worker.sh @@ -266,9 +266,10 @@ fi mkdir -p database/$INPUTBASENAME/ # Take screenshot -import -window "$(xdotool getactivewindow)" database/$INPUTBASENAME/screenshot.png && echo "Screenshot taken" +import -window "$(xdotool getactivewindow)" database/$INPUTBASENAME/screenshot.png & +sleep 1 -kill $APID && printf "\n\n\n* * * SUCCESS :-) * * *\n\n\n" || exit 1 +kill $APID || exit 1 killall icewm # Check if the screenshot is unusable and error out if it is