Skip to content

Instantly share code, notes, and snippets.

@mccaffers
Last active April 4, 2025 19:15
Show Gist options
  • Select an option

  • Save mccaffers/c344a9df59b69c811d543481f0e565c5 to your computer and use it in GitHub Desktop.

Select an option

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