#! /usr/bin/env bash BUILD_DIR=build WALLPAPERS_PATH=workshop_wallpapers_11-8-21 while : ; do DIR=$(find $WALLPAPERS_PATH -mindepth 1 -maxdepth 1 -type d -print0 | shuf -zn1 | xargs --null) if [[ $1 == "audio" ]] then RES=$(cat $DIR/project.json | jq '.["general"]["supportsaudioprocessing"]') [[ ! -f $DIR/scene.pkg || "$RES" == 'null' || "$RES" == 'false' ]] || break elif [[ $1 == "safe" ]] then RES=$(cat $DIR/project.json | jq '.["contentrating"]') [[ ! -f $DIR/scene.pkg || "$RES" == 'null' || "$RES" != '"Everyone"' ]] || break else [[ ! -f $DIR/scene.pkg ]] || break fi done echo $DIR cd $BUILD_DIR ./mauri -p ../$DIR/scene.pkg -a /mnt/hdd/SteamLibrary/steamapps/common/wallpaper_engine/assets -w 1600 -h 900 cd ..