From 11746d34d98140e38cdcee49bb22f9ca2b9c84c0 Mon Sep 17 00:00:00 2001 From: icenine451 Date: Wed, 8 Mar 2023 15:07:28 -0500 Subject: [PATCH] Basic Easter Egg framework --- functions.sh | 21 ++++++++++++++++++++- net.retrodeck.retrodeck.yml | 9 ++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/functions.sh b/functions.sh index a9882341..8430d21d 100644 --- a/functions.sh +++ b/functions.sh @@ -127,7 +127,7 @@ compress_to_chd () { validate_for_chd () { # Function for validating chd compression candidates, and compresses if validation passes. Supports .cue, .iso and .gdi formats ONLY # USAGE: validate_for_chd $input_file - + local file=$1 current_run_log_file="chd_compression_"$(date +"%Y_%m_%d_%I_%M_%p").log"" echo "Validating file:" $file > "$logs_folder/$current_run_log_file" @@ -1060,7 +1060,26 @@ create_lock() { conf_write } +easter_eggs() { + today=$(date +"%0m%0d") # Read the current date in a format that can be calculated in ranges + + # 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 +} + start_retrodeck() { + echo "Checking to see if today has a surprise..." + easter_eggs # normal startup echo "Starting RetroDECK v$version" emulationstation --home /var/config/emulationstation diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml index 841123e4..207eb8fe 100644 --- a/net.retrodeck.retrodeck.yml +++ b/net.retrodeck.retrodeck.yml @@ -1049,9 +1049,12 @@ modules: # These must be put in home folder, managed by retrodeck.sh - cp es-configs/es_settings.xml ${FLATPAK_DEST}/retrodeck/es_settings.xml - # Logo, res - - rm -f /app/share/emulationstation/resources/graphics/splash.svg - - cp -f res/splash.svg /app/share/emulationstation/resources/graphics/splash.svg + # Logo, res, move graphics directory to mutable space so splash can be changed after build + - mv -f -t /var/config/emulationstation /app/share/emulationstation/resources/graphics + - ln -s /var/config/emulationstation/graphics /app/share/emulationstation/resources/graphics + - cp -f res/extra-splashes/* /var/config/emulationstation/graphics + - cp -f res/splash.svg /var/config/emulationstation/graphics/splash.svg + - cp -f res/splash.svg /var/config/emulationstation/graphics/splash-orig.svg - cp -f res/icon.svg /app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg # Tools