Skip to content

Instantly share code, notes, and snippets.

@astromme
Created January 23, 2021 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astromme/a77969a1e91bafce4b444eae7366de7a to your computer and use it in GitHub Desktop.
Save astromme/a77969a1e91bafce4b444eae7366de7a to your computer and use it in GitHub Desktop.
Creates many copies of images in the correct format so that the mac screensaver shows them for a longer duration.
#!/bin/bash
# assuming convert.sh is in the folder you want the new images to be in,
# and the source images are one level up, then run with:
# ./convert_for_screensaver.sh ../*.{JPG,jpg}
# each copy shows for about 5 seconds, so 120 copies is about 6 minutes per slide
copies=120
num=1
for i in $@
do
command="convert $i -geometry 2560x1440^ -gravity center -crop 2560x1440+0+0 $num.jpg"
echo $command
eval "$command"
for j in $(seq 1 $copies)
do
command="ln $num.jpg $num-$j.jpg"
echo $command
eval "$command"
done
((num++))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment