run-over-all-backgrounds.sh 969 B

1234567891011121314151617181920212223242526272829
  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. exit
  6. fi
  7. # ensure the output and images directory exists
  8. [ -d "output" ] || mkdir output
  9. for folder in ~/.steam/steam/steamapps/workshop/content/431960/*; do
  10. # only directories matter
  11. if [ -d "$folder" ]; then
  12. bgid=$(basename "$folder")
  13. echo "Running wallpaperengine for background $bgid and waiting for it to finish"
  14. # run and wait for it to finish
  15. $1 $bgid 2>&1 | grep -v "Error receiving video packet: " > output/$bgid.log
  16. if [ -f "output.webm" ]; then
  17. # move output.webm to the output folder with the right name
  18. mv output.webm output/$bgid.webm
  19. # take a screenshot
  20. ffmpeg -ss 00:00:03 -i output/$bgid.webm -frames:v 1 output/$bgid.jpg
  21. # copy over the project.json so we have it on hand
  22. cp $folder/project.json output/$bgid.json
  23. fi
  24. fi
  25. done