diff --git a/functions/checks.sh b/functions/checks.sh index 4a2961d1..c8e91a2a 100644 --- a/functions/checks.sh +++ b/functions/checks.sh @@ -28,6 +28,17 @@ check_desktop_mode() { fi } +check_is_steam_deck() { + # This function will check the internal product ID for the Steam Deck codename and return "true" if RetroDECK is running on a real Deck + # USAGE: if [[ $(check_is_steam_deck) == "true" ]]; then + + if [[ $(cat /sys/devices/virtual/dmi/id/product_name) =~ ^(Jupiter|Galileo)$ ]]; then + echo "true" + else + echo "false" + fi +} + check_for_version_update() { # This function will perform a basic online version check and alert the user if there is a new version available. diff --git a/functions/dialogs.sh b/functions/dialogs.sh index 1441cc4f..c0789042 100644 --- a/functions/dialogs.sh +++ b/functions/dialogs.sh @@ -222,7 +222,6 @@ desktop_mode_warning() { --text="$message") rc=$? # Capture return code, as "Yes" button has no text value if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked - log i "Selected: \"Yes\"" if [[ $choice == "No" ]]; then log i "Selected: \"No\"" exit 1 @@ -230,6 +229,8 @@ desktop_mode_warning() { log i "Selected: \"Never show this again\"" set_setting_value $rd_conf "desktop_mode_warning" "false" retrodeck "options" # Store desktop mode warning variable for future checks fi + else + log i "Selected: \"Yes\"" fi fi } diff --git a/retrodeck.sh b/retrodeck.sh index b4ec2f19..834ee224 100644 --- a/retrodeck.sh +++ b/retrodeck.sh @@ -166,8 +166,9 @@ if [[ $multi_user_mode == "true" ]]; then fi # Run optional startup checks - -desktop_mode_warning +if [[ $(check_is_steam_deck) == "true" ]]; then # Only warn about Desktop Mode on Steam Deck, ignore for other platforms + desktop_mode_warning +fi low_space_warning # Check if there is a new version of RetroDECK available, if update_check=true in retrodeck.cfg and there is network connectivity available.