Created
June 19, 2018 02:56
-
-
Save ktr0731/59275f561c765430f095234da4e5e64c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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