From 51d8a343eba5ff54a413d7a9872692c405a6ae0e Mon Sep 17 00:00:00 2001 From: icenine451 Date: Thu, 9 Mar 2023 15:58:13 -0500 Subject: [PATCH] Easter eggs updates and fixes to manifest --- functions.sh | 30 +++++++++++++++++------------- global.sh | 22 +++++++++++++--------- net.retrodeck.retrodeck.yml | 4 ++-- 3 files changed, 32 insertions(+), 24 deletions(-) diff --git a/functions.sh b/functions.sh index 772c6b6c..02c49a23 100644 --- a/functions.sh +++ b/functions.sh @@ -1062,20 +1062,24 @@ create_lock() { } easter_eggs() { - today=$(date +"%0m%0d") # Read the current date in a format that can be calculated in ranges + # This function will replace the RetroDECK startup splash screen with a different image if the day and time match a listing in easter_egg_checklist.cfg + # The easter_egg_checklist.cfg file has the current format: $start_date^$end_date^$start_time^$end_time^$splash_file + # Ex. The line "1001^1031^0000^2359^spooky.svg" would show the file "spooky.svg" During any time of day in the month of October + # The easter_egg_checklist.cfg is read in order, so lines higher in the file will have higher priority in the event of an overlap + # USAGE: easter_eggs + current_day=$(date +"%0m%0d") # Read the current date in a format that can be calculated in ranges + current_time=$(date +"%0H%0M") # Read the current time in a format that can be calculated in ranges + while IFS="^" read -r start_date end_date start_time end_time splash_file # Read Easter Egg checklist file and separate values + do + if [[ $current_day -ge "$start_date" && $current_day -le "$end_date" && $current_time -ge "$start_time" && $current_time -le "$end_time" ]]; then # If current line specified date/time matches current date/time, set $splash_file to be deployed + new_splash_file="$splashscreen_dir/$splash_file" + break + else # When there are no matches, the default splash screen is set to deploy + new_splash_file="$default_splash_file" + fi + done < $easter_egg_checklist - # Set Easter Egg date or ranges here, in mmdd format - - if [[ today -eq "0401" ]]; then # An example of a one-day easter egg - echo "Today is April Fools Day!" - # cp -fv /var/config/emulationstation/graphics/splash-aprilfools.svg /var/config/emulationstation/graphics/splash.svg - elif [[ today -ge "1001" && today -le "1031" ]]; then # An example of a multi-day easter egg - echo "Today is in the spooky month!" - # cp -fv /var/config/emulationstation/graphics/splash-spookytime.svg /var/config/emulationstation/graphics/splash.svg - else # Revert to standard splash otherwise - echo "Nothing special happening today" - # cp -fv /var/config/emulationstation/graphics/splash-orig.svg /var/config/emulationstation/graphics/splash.svg - fi + cp -fv "$new_splash_file $current_splash_file" # Deploy assigned splash screen } start_retrodeck() { diff --git a/global.sh b/global.sh index 5351a3fa..7bfd48fa 100755 --- a/global.sh +++ b/global.sh @@ -5,15 +5,19 @@ source /app/libexec/functions.sh # Static variables -rd_conf="/var/config/retrodeck/retrodeck.cfg" # RetroDECK config file path -rd_conf_backup="/var/config/retrodeck/retrodeck.bak" # Backup of RetroDECK config file from update -emuconfigs="/app/retrodeck/emu-configs" # folder with all the default emulator configs -rd_defaults="$emuconfigs/defaults/retrodeck.cfg" # A default RetroDECK config file -rd_update_patch="/var/config/retrodeck/rd_update.patch" # A static location for the temporary patch file used during retrodeck.cfg updates -bios_checklist="/var/config/retrodeck/tools/bios_checklist.cfg" # A config file listing BIOS file information that can be verified -lockfile="/var/config/retrodeck/.lock" # where the lockfile is located -default_sd="/run/media/mmcblk0p1" # Steam Deck SD default path -hard_version="$(cat '/app/retrodeck/version')" # hardcoded version (in the readonly filesystem) +rd_conf="/var/config/retrodeck/retrodeck.cfg" # RetroDECK config file path +rd_conf_backup="/var/config/retrodeck/retrodeck.bak" # Backup of RetroDECK config file from update +emuconfigs="/app/retrodeck/emu-configs" # folder with all the default emulator configs +rd_defaults="$emuconfigs/defaults/retrodeck.cfg" # A default RetroDECK config file +rd_update_patch="/var/config/retrodeck/rd_update.patch" # A static location for the temporary patch file used during retrodeck.cfg updates +bios_checklist="/var/config/retrodeck/tools/bios_checklist.cfg" # A config file listing BIOS file information that can be verified +easter_egg_checklist="/var/config/retrodeck/tools/easter_egg_checklist.cfg" # A config file listing days and times when special splash screens should show up +splashscreen_dir="/var/config/emulationstation/graphics/extra-splashes" # The default location of extra splash screens +current_splash_file="/var/config/emulationstation/graphics/splash.svg" # The active splash file that will be shown on boot +default_splash_file="/var/config/emulationstation/graphics/splash-orig.svg" # The default RetroDECK splash screen +lockfile="/var/config/retrodeck/.lock" # where the lockfile is located +default_sd="/run/media/mmcblk0p1" # Steam Deck SD default path +hard_version="$(cat '/app/retrodeck/version')" # hardcoded version (in the readonly filesystem) # Config files for emulators with single config files diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 462611c5..321dbf9d 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -1066,10 +1066,10 @@ modules: - cp retrodeck.sh /app/bin/retrodeck.sh - chmod +x /app/bin/retrodeck.sh + # Function libraries + - mkdir -p /app/libexec - cp global.sh /app/libexec/global.sh - - cp functions.sh /app/libexec/functions.sh - - cp post_update.sh /app/libexec/post_update.sh # Desktop entry