Skip to content

Instantly share code, notes, and snippets.

@dgellow
Created January 30, 2016 05:49
Show Gist options
  • Save dgellow/3a2879c8de4765daf585 to your computer and use it in GitHub Desktop.
Save dgellow/3a2879c8de4765daf585 to your computer and use it in GitHub Desktop.
# Dependencies:
# - Xvfb (package xvfb on Debian)
# - ImageMagick (package imagemagick on Debian)
capture:
mkdir -p screenshots
export DISPLAY=":1"
pkill Xvfb
sleep 2
Xvfb :1 -screen 0 1920x1200x24 +extension RANDR &
for i in `seq $(nbScreenshots)`; do \
pkill game; \
sleep 2; \
$(buildDir)/game --test-run & sleep 1; \
import -window root -crop 1920x1200+0+0 -quality 90 "screenshots/image_${i}.png"; \
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment