run-over-all-backgrounds.sh 708 B

1234567891011121314151617181920212223
  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. [ -d "output" ] || mkdir output
  8. for folder in ~/.steam/steam/steamapps/workshop/content/431960/*; do
  9. if [ -d "$folder" ]; then
  10. bgid=$(basename "$folder")
  11. echo "Running wallpaperengine for background $bgid and waiting for it to finish"
  12. $1 $bgid 2>&1 | grep -v "Error receiving video packet: " > output/$bgid.log
  13. if [ -f "output.webm" ]; then
  14. mv output.webm output/$bgid.webm
  15. ffmpeg -ss 00:00:03 -i output/$bgid.webm -frames:v 1 output/$bgid.jpg
  16. cp $folder/project.json output/$bgid.json
  17. fi
  18. fi
  19. done