Skip to content

Instantly share code, notes, and snippets.

@mccaffers
Last active May 12, 2024 09:56
Show Gist options
  • Save mccaffers/c344a9df59b69c811d543481f0e565c5 to your computer and use it in GitHub Desktop.
Save mccaffers/c344a9df59b69c811d543481f0e565c5 to your computer and use it in GitHub Desktop.
Bash script to take a screenshot on macOS every minute, converts to webp
# Take a screenshot on macOS every minute
# converts the screenshot to webp to reduce file size
while :;
do
name=$(date +%m\-%d\-%y\_%H.%M.%S);
screencapture -m -D 1 -t png ~/Desktop/screenshots/$name.png;
convert ~/Desktop/screenshots/$name.png ~/Desktop/screenshots/$name.webp;
rm -rf ~/Desktop/screenshots/$name.png;
sleep 60;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment