Skip to content

Instantly share code, notes, and snippets.

@makenai
Created April 22, 2017 03:11
Show Gist options
  • Save makenai/8e27edd74e30fbd3fbab697b4fb05773 to your computer and use it in GitHub Desktop.
Save makenai/8e27edd74e30fbd3fbab697b4fb05773 to your computer and use it in GitHub Desktop.
#!/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