Created
April 22, 2017 03:11
-
-
Save makenai/8e27edd74e30fbd3fbab697b4fb05773 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
#!/bin/bash | |
SCREEN_COUNT=0 | |
echo Capture started on `date` | |
echo Capture started on `date` >> log.txt | |
trap ctrl_c INT | |
function ctrl_c() { | |
echo Capture ended on `date` with $SCREEN_COUNT screens captured. | |
echo Capture ended on `date` with $SCREEN_COUNT screens captured. >> log.txt | |
exit | |
} | |
while true | |
do | |
sleep 30 | |
FILENAME=screens/screen.`date +%s`.jpg | |
echo Capturing to $FILENAME | |
screencapture -C -m -t jpg -x -f $FILENAME | |
SCREEN_COUNT=$((SCREEN_COUNT+1)) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment