mirror of
https://github.com/RetroDECK/RetroDECK.git
synced 2024-11-22 14:05:39 +00:00
Basic Easter Egg framework
This commit is contained in:
parent
2af2ebe09f
commit
11746d34d9
21
functions.sh
21
functions.sh
|
@ -127,7 +127,7 @@ compress_to_chd () {
|
||||||
validate_for_chd () {
|
validate_for_chd () {
|
||||||
# Function for validating chd compression candidates, and compresses if validation passes. Supports .cue, .iso and .gdi formats ONLY
|
# Function for validating chd compression candidates, and compresses if validation passes. Supports .cue, .iso and .gdi formats ONLY
|
||||||
# USAGE: validate_for_chd $input_file
|
# USAGE: validate_for_chd $input_file
|
||||||
|
|
||||||
local file=$1
|
local file=$1
|
||||||
current_run_log_file="chd_compression_"$(date +"%Y_%m_%d_%I_%M_%p").log""
|
current_run_log_file="chd_compression_"$(date +"%Y_%m_%d_%I_%M_%p").log""
|
||||||
echo "Validating file:" $file > "$logs_folder/$current_run_log_file"
|
echo "Validating file:" $file > "$logs_folder/$current_run_log_file"
|
||||||
|
@ -1060,7 +1060,26 @@ create_lock() {
|
||||||
conf_write
|
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() {
|
start_retrodeck() {
|
||||||
|
echo "Checking to see if today has a surprise..."
|
||||||
|
easter_eggs
|
||||||
# normal startup
|
# normal startup
|
||||||
echo "Starting RetroDECK v$version"
|
echo "Starting RetroDECK v$version"
|
||||||
emulationstation --home /var/config/emulationstation
|
emulationstation --home /var/config/emulationstation
|
||||||
|
|
|
@ -1049,9 +1049,12 @@ modules:
|
||||||
# These must be put in home folder, managed by retrodeck.sh
|
# These must be put in home folder, managed by retrodeck.sh
|
||||||
- cp es-configs/es_settings.xml ${FLATPAK_DEST}/retrodeck/es_settings.xml
|
- cp es-configs/es_settings.xml ${FLATPAK_DEST}/retrodeck/es_settings.xml
|
||||||
|
|
||||||
# Logo, res
|
# Logo, res, move graphics directory to mutable space so splash can be changed after build
|
||||||
- rm -f /app/share/emulationstation/resources/graphics/splash.svg
|
- mv -f -t /var/config/emulationstation /app/share/emulationstation/resources/graphics
|
||||||
- cp -f res/splash.svg /app/share/emulationstation/resources/graphics/splash.svg
|
- 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
|
- cp -f res/icon.svg /app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg
|
||||||
|
|
||||||
# Tools
|
# Tools
|
||||||
|
|
Loading…
Reference in a new issue