mardi 4 octobre 2022

Random Boot Animation Script (Steam Deck)

I've hacked this together with random code from stack exchange I would love someone who can actually script to look it over and let me know what else I need to do to it.

the goals of this script,

  1. to look at *.webm files in a folder (or subfolders recursively)
  2. pick one at random
  3. create a temp folder
  4. place a copy of the file in the temp folder
  5. move and rename the file to a hardcoded name and location (the custom boot animation folder for the Steam Deck)
  6. delete the temp folder (cleanup for next time)

Other goal for the script, to be ran as a cron job on @reboot so that everytime the steam deck boots it changes to a random collection of boot animations

#!/usr/bin/env bash

shopt -s nullglob
files=(*.webm)
shopt -u nullglob
if [[ ${#files[@]} -eq 0 ]]; then
  echo "No matching files!"
  exit
fi
file=${files[$((RANDOM % ${#files[@]}))]}

mkdir ~/.local/bootvidstaging
cp "$file" ~/.local/bootvidstaging
cd ~/.local/bootvidstaging
mv *.webm ~/.local/share/Steam/steamui/overrides/movies/deck_startup.webm
rm -rf ~/.local/bootvidstaging

end

I would like to have a hard location for the storage of the boot animations (~/.local/bootanimations)

thanks in advance, this is obviously above my skill level (Im sure my script is wrong) but I am learning as I go so breaking it down for me and pointing me to the resources I need to look at are very very welcome




Aucun commentaire:

Enregistrer un commentaire