Easter eggs updates and fixes to manifest

This commit is contained in:
icenine451 2023-03-09 15:58:13 -05:00
parent 71a26e0a4d
commit 51d8a343eb
3 changed files with 32 additions and 24 deletions

View file

@ -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
# 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
# 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
cp -fv "$new_splash_file $current_splash_file" # Deploy assigned splash screen
}
start_retrodeck() {

View file

@ -11,6 +11,10 @@ emuconfigs="/app/retrodeck/emu-configs" # folder with al
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)

View file

@ -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