Make sure the application gets killed even if the screenshot taking fails

This commit is contained in:
probonopd authored and GitHub committed 2021-07-24 11:42:29 +02:00
1 parent ee6d036797
commit b4907b82ff
1 file changed
+3 -2
+3 -2
View File
@@ -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