Skip to content

Instantly share code, notes, and snippets.

@ktr0731
Created June 19, 2018 02:56
Show Gist options
  • Save ktr0731/59275f561c765430f095234da4e5e64c to your computer and use it in GitHub Desktop.
Save ktr0731/59275f561c765430f095234da4e5e64c to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -e
if [ "$#" -ne 2 ]; then
echo "usage: ./script <dst> <duration (m)>"
exit 1
fi
echo "start after 3 seconds"
sleep 3
dst=$1
duration=$2
mkdir -p "$dst"
num="$(expr $duration \* 60 / 5)"
echo $num
for i in $(seq 0 $num); do
screencapture -m -T0 -x "$dst/$(date +%s).png"
echo "captured $i"
sleep 5
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment