run-over-all-backgrounds.sh 839 B

12345678910111213141516171819202122232425
  1. #!/bin/bash
  2. if [ $# -eq 0 ]
  3. then
  4. echo "Please provide the current build's executable path. You might want to run this script off the same folder."
  5. fi
  6. # ensure the output and images directory exists
  7. [ -d "output" ] || mkdir output
  8. for folder in ~/.steam/steam/steamapps/workshop/content/431960/*; do
  9. # only directories matter
  10. if [ -d "$folder" ]; then
  11. bgid=$(basename "$folder")
  12. echo "Running wallpaperengine for background $bgid and waiting for it to finish"
  13. # run and wait for it to finish
  14. $1 $bgid
  15. # move output.webm to the output folder with the right name
  16. mv output.webm output/$bgid.webm
  17. # take a screenshot
  18. ffmpeg -ss 00:00:03 -i output/$bgid.webm -frames:v 1 output/$bgid.jpg
  19. # copy over the project.json so we have it on hand
  20. cp $folder/project.json output/$bgid.json
  21. fi
  22. done