|
|
|
@ -224,14 +224,14 @@ desktop_mode_warning() {
|
|
|
|
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
|
|
|
|
--title "RetroDECK Desktop Mode Warning" \
|
|
|
|
|
--text="You appear to be running RetroDECK in the Steam Deck's Desktop mode!\n\nSome functions of RetroDECK may not work properly in Desktop mode, such as the Steam Deck's normal controls.\n\nRetroDECK is best enjoyed in Game mode!\n\nDo you still want to proceed?")
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
rc=$? # Capture return code, as "Yes" button has no text value
|
|
|
|
|
if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
|
|
|
|
|
if [[ $choice == "No" ]]; then
|
|
|
|
|
exit 1
|
|
|
|
|
elif [[ $choice == "Never show this again" ]]; then
|
|
|
|
|
set_setting_value $rd_conf "desktop_mode_warning" "false" retrodeck # Store desktop mode warning variable for future checks
|
|
|
|
|
rc=$? # Capture return code, as "Yes" button has no text value
|
|
|
|
|
if [[ $rc == "1" ]]; then # If any button other than "Yes" was clicked
|
|
|
|
|
if [[ $choice == "No" ]]; then
|
|
|
|
|
exit 1
|
|
|
|
|
elif [[ $choice == "Never show this again" ]]; then
|
|
|
|
|
set_setting_value $rd_conf "desktop_mode_warning" "false" retrodeck # Store desktop mode warning variable for future checks
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
@ -248,38 +248,38 @@ set_setting_value() {
|
|
|
|
|
|
|
|
|
|
"retrodeck" | "citra" | "melonds" | "yuzu" )
|
|
|
|
|
if [[ -z $current_section_name ]]; then
|
|
|
|
|
sed -i 's^'"$setting_name_to_change"'=.*^'"$setting_name_to_change"'='"$setting_value_to_change"'^' $1
|
|
|
|
|
sed -i 's^\^'"$setting_name_to_change"'=.*^'"$setting_name_to_change"'='"$setting_value_to_change"'^' $1
|
|
|
|
|
else
|
|
|
|
|
sed -i '\^\['"$current_section_name"'\]^,\^'"$setting_name_to_change"'.*^s^'"$setting_name_to_change"'=.*^'"$setting_name_to_change"'='"$setting_value_to_change"'^' $1
|
|
|
|
|
sed -i '\^\['"$current_section_name"'\]^,\^\^'"$setting_name_to_change"'.*^s^\^'"$setting_name_to_change"'=.*^'"$setting_name_to_change"'='"$setting_value_to_change"'^' $1
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"retroarch" )
|
|
|
|
|
if [[ -z $current_section_name ]]; then
|
|
|
|
|
sed -i 's^'"$setting_name_to_change"' = \".*\"^'"$setting_name_to_change"' = \"'"$setting_value_to_change"'\"^' $1
|
|
|
|
|
sed -i 's^\^'"$setting_name_to_change"' = \".*\"^'"$setting_name_to_change"' = \"'"$setting_value_to_change"'\"^' $1
|
|
|
|
|
else
|
|
|
|
|
sed -i '\^\['"$current_section_name"'\]^,\^'"$setting_name_to_change"'.*^s^'"$setting_name_to_change"' = \".*\"^'"$setting_name_to_change"' = \"'"$setting_value_to_change"'\"^' $1
|
|
|
|
|
sed -i '\^\['"$current_section_name"'\]^,\^\^'"$setting_name_to_change"'.*^s^\^'"$setting_name_to_change"' = \".*\"^'"$setting_name_to_change"' = \"'"$setting_value_to_change"'\"^' $1
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"dolphin" | "duckstation" | "pcsx2" | "ppsspp" | "xemu" )
|
|
|
|
|
"dolphin" | "duckstation" | "pcsx2" | "ppsspp" | "primehack" | "xemu" )
|
|
|
|
|
if [[ -z $current_section_name ]]; then
|
|
|
|
|
sed -i 's^'"$setting_name_to_change"' =.*^'"$setting_name_to_change"' = '"$setting_value_to_change"'^' $1
|
|
|
|
|
sed -i 's^\^'"$setting_name_to_change"' =.*^'"$setting_name_to_change"' = '"$setting_value_to_change"'^' $1
|
|
|
|
|
else
|
|
|
|
|
sed -i '\^\['"$current_section_name"'\]^,\^'"$setting_name_to_change"'.*^s^'"$setting_name_to_change"' =.*^'"$setting_name_to_change"' = '"$setting_value_to_change"'^' $1
|
|
|
|
|
sed -i '\^\['"$current_section_name"'\]^,\^\^'"$setting_name_to_change"'.*^s^\^'"$setting_name_to_change"' =.*^'"$setting_name_to_change"' = '"$setting_value_to_change"'^' $1
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"rpcs3" ) # This does not currently work for settings with a $ in them
|
|
|
|
|
if [[ -z $current_section_name ]]; then
|
|
|
|
|
sed -i 's^'"$setting_name_to_change"': .*^'"$setting_name_to_change"': '"$setting_value_to_change"'^' $1
|
|
|
|
|
sed -i 's^\^'"$setting_name_to_change"': .*^'"$setting_name_to_change"': '"$setting_value_to_change"'^' $1
|
|
|
|
|
else
|
|
|
|
|
sed -i '\^\['"$current_section_name"'\]^,\^'"$setting_name_to_change"'.*^s^'"$setting_name_to_change"': .*^'"$setting_name_to_change"': '"$setting_value_to_change"'^' $1
|
|
|
|
|
sed -i '\^\['"$current_section_name"'\]^,\^\^'"$setting_name_to_change"'.*^s^\^'"$setting_name_to_change"': .*^'"$setting_name_to_change"': '"$setting_value_to_change"'^' $1
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"emulationstation" )
|
|
|
|
|
sed -i "s%$setting_name_to_change\" \" value=\".*\"%$setting_name_to_change\" \" value=\"$setting_value_to_change\"" $1
|
|
|
|
|
sed -i "s%^$setting_name_to_change\" \" value=\".*\"%$setting_name_to_change\" \" value=\"$setting_value_to_change\"" $1
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
esac
|
|
|
|
@ -321,7 +321,7 @@ get_setting_value() {
|
|
|
|
|
if [[ -z $current_section_name ]]; then
|
|
|
|
|
echo $(grep -o -P "(?<=^$current_setting_name=).*" $1)
|
|
|
|
|
else
|
|
|
|
|
sed -n '\^\['"$current_section_name"'\]^,\^'"$current_setting_name"'^{ \^\['"$current_section_name"'\]^! { \^'"$current_setting_name"'^ p } }' $1 | grep -o -P "(?<=^$current_setting_name=).*"
|
|
|
|
|
sed -n '\^\['"$current_section_name"'\]^,\^\^'"$current_setting_name"'^{ \^\['"$current_section_name"'\]^! { \^\^'"$current_setting_name"'^ p } }' $1 | grep -o -P "(?<=^$current_setting_name=).*"
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
@ -329,15 +329,15 @@ get_setting_value() {
|
|
|
|
|
if [[ -z $current_section_name ]]; then
|
|
|
|
|
echo $(grep -o -P "(?<=^$current_setting_name = \").*(?=\")" $1)
|
|
|
|
|
else
|
|
|
|
|
sed -n '\^\['"$current_section_name"'\]^,\^'"$current_setting_name"'^{ \^\['"$current_section_name"'\]^! { \^'"$current_setting_name"'^ p } }' $1 | grep -o -P "(?<=^$current_setting_name = \").*(?=\")"
|
|
|
|
|
sed -n '\^\['"$current_section_name"'\]^,\^\^'"$current_setting_name"'^{ \^\['"$current_section_name"'\]^! { \^\^'"$current_setting_name"'^ p } }' $1 | grep -o -P "(?<=^$current_setting_name = \").*(?=\")"
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"dolphin" | "duckstation" | "pcsx2" | "ppsspp" | "xemu" ) # For files with this syntax - setting_name = setting_value
|
|
|
|
|
"dolphin" | "duckstation" | "pcsx2" | "ppsspp" | "primehack" | "xemu" ) # For files with this syntax - setting_name = setting_value
|
|
|
|
|
if [[ -z $current_section_name ]]; then
|
|
|
|
|
echo $(grep -o -P "(?<=^$current_setting_name = ).*" $1)
|
|
|
|
|
else
|
|
|
|
|
sed -n '\^\['"$current_section_name"'\]^,\^'"$current_setting_name"'^{ \^\['"$current_section_name"'\]^! { \^'"$current_setting_name"'^ p } }' $1 | grep -o -P "(?<=^$current_setting_name = ).*"
|
|
|
|
|
sed -n '\^\['"$current_section_name"'\]^,\^\^'"$current_setting_name"'^{ \^\['"$current_section_name"'\]^! { \^\^'"$current_setting_name"'^ p } }' $1 | grep -o -P "(?<=^$current_setting_name = ).*"
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
@ -345,7 +345,7 @@ get_setting_value() {
|
|
|
|
|
if [[ -z $current_section_name ]]; then
|
|
|
|
|
echo $(grep -o -P "(?<=$current_setting_name: ).*" $1)
|
|
|
|
|
else
|
|
|
|
|
sed -n '\^\['"$current_section_name"'\]^,\^'"$current_setting_name"'^{ \^\['"$current_section_name"'\]^! { \^'"$current_setting_name"'^ p } }' $1 | grep -o -P "(?<=$current_setting_name: ).*"
|
|
|
|
|
sed -n '\^\['"$current_section_name"'\]^,\^\^'"$current_setting_name"'^{ \^\['"$current_section_name"'\]^! { \^\^'"$current_setting_name"'^ p } }' $1 | grep -o -P "(?<=$current_setting_name: ).*"
|
|
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
@ -380,7 +380,7 @@ disable_setting() {
|
|
|
|
|
# This function will add a '#' to the beginning of a defined setting line, disabling it.
|
|
|
|
|
# USAGE: disable_setting $setting_file $setting_line $system $section (optional)
|
|
|
|
|
|
|
|
|
|
local current_setting_line"$2"
|
|
|
|
|
local current_setting_line="$2"
|
|
|
|
|
local current_section_name="$4"
|
|
|
|
|
|
|
|
|
|
case $3 in
|
|
|
|
@ -400,7 +400,7 @@ enable_setting() {
|
|
|
|
|
# This function will remove a '#' to the beginning of a defined setting line, enabling it.
|
|
|
|
|
# USAGE: enable_setting $setting_file $setting_line $system $section (optional)
|
|
|
|
|
|
|
|
|
|
local current_setting_line"$2"
|
|
|
|
|
local current_setting_line="$2"
|
|
|
|
|
local current_section_name="$4"
|
|
|
|
|
|
|
|
|
|
case $3 in
|
|
|
|
@ -545,31 +545,35 @@ do
|
|
|
|
|
case $action in
|
|
|
|
|
|
|
|
|
|
"disable_file" )
|
|
|
|
|
disable_file $setting_name
|
|
|
|
|
eval disable_file $setting_name
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"enable_file" )
|
|
|
|
|
enable_file $setting_name
|
|
|
|
|
eval enable_file $setting_name
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"add_setting" )
|
|
|
|
|
add_setting $3 "$setting_name" $system_name $current_section
|
|
|
|
|
eval add_setting $3 "$setting_name" $system_name $current_section
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"disable_setting" )
|
|
|
|
|
disable_setting $3 "$setting_name" $system_name $current_section
|
|
|
|
|
eval disable_setting $3 "$setting_name" $system_name $current_section
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"enable_setting" )
|
|
|
|
|
enable_setting $3 "$setting_name" $system_name $current_section
|
|
|
|
|
eval enable_setting $3 "$setting_name" $system_name $current_section
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"change" )
|
|
|
|
|
set_setting_value $3 "$setting_name" "$setting_value" $system_name $current_section
|
|
|
|
|
eval set_setting_value $3 "$setting_name" "$setting_value" $system_name $current_section
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
*"#"* )
|
|
|
|
|
# Comment line in patch file
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
* )
|
|
|
|
|
echo "Config file malformed"
|
|
|
|
|
echo "Config line malformed: $action"
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
esac
|
|
|
|
@ -588,31 +592,35 @@ do
|
|
|
|
|
case $action in
|
|
|
|
|
|
|
|
|
|
"disable_file" )
|
|
|
|
|
disable_file $config_file
|
|
|
|
|
eval disable_file $config_file
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"enable_file" )
|
|
|
|
|
enable_file $config_file
|
|
|
|
|
eval enable_file $config_file
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"add_setting" )
|
|
|
|
|
add_setting $config_file "$setting_name" $system_name $current_section
|
|
|
|
|
eval add_setting $config_file "$setting_name" $system_name $current_section
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"disable_setting" )
|
|
|
|
|
disable_setting $config_file "$setting_name" $system_name $current_section
|
|
|
|
|
eval disable_setting $config_file "$setting_name" $system_name $current_section
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"enable_setting" )
|
|
|
|
|
enable_setting $config_file "$setting_name" $system_name $current_section
|
|
|
|
|
eval enable_setting $config_file "$setting_name" $system_name $current_section
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
"change" )
|
|
|
|
|
set_setting_value $config_file "$setting_name" "$setting_value" $system_name $current_section
|
|
|
|
|
eval set_setting_value $config_file "$setting_name" "$setting_value" $system_name $current_section
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
*"#"* )
|
|
|
|
|
# Comment line in patch file
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
* )
|
|
|
|
|
echo "Config file malformed"
|
|
|
|
|
echo "Config line malformed: $action"
|
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
esac
|
|
|
|
@ -1283,18 +1291,19 @@ finit() {
|
|
|
|
|
|
|
|
|
|
mkdir -pv $roms_folder
|
|
|
|
|
|
|
|
|
|
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --text="RetroDECK will now install the needed files.\nPlease wait up to one minute,\nanother message will notify when the process will be finished.\n\nPress OK to continue."
|
|
|
|
|
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \
|
|
|
|
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" \
|
|
|
|
|
--text="RetroDECK will now install the needed files, which can take up to one minute.\nRetroDECK will start once the process is completed.\n\nPress OK to continue."
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
|
# Recreating the folder
|
|
|
|
|
rm -rfv /var/config/emulationstation/
|
|
|
|
|
mkdir -pv /var/config/emulationstation/
|
|
|
|
|
rm -rf /var/config/emulationstation/
|
|
|
|
|
mkdir -p /var/config/emulationstation/
|
|
|
|
|
|
|
|
|
|
# Initializing ES-DE
|
|
|
|
|
# TODO: after the next update of ES-DE this will not be needed - let's test it
|
|
|
|
|
emulationstation --home /var/config/emulationstation --create-system-dirs
|
|
|
|
|
|
|
|
|
|
#zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap --window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" --title "RetroDECK" --text="RetroDECK will now install the needed files.\nPlease wait up to one minute,\nanother message will notify when the process will be finished.\n\nPress OK to continue."
|
|
|
|
|
|
|
|
|
|
# Initializing ROMs folder - Original in retrodeck home (or SD Card)
|
|
|
|
|
dir_prep $roms_folder "/var/config/emulationstation/ROMs"
|
|
|
|
|
|
|
|
|
@ -1315,7 +1324,6 @@ finit() {
|
|
|
|
|
dir_prep "$roms_folder/pico8" "$bios_folder/pico-8/carts" # Symlink default game location to RD roms for cleanliness (this location is overridden anyway by the --root_path launch argument anyway)
|
|
|
|
|
dir_prep "$saves_folder/pico-8" "$bios_folder/pico-8/cdata" # PICO-8 saves folder
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
|
ra_init
|
|
|
|
|
standalones_init
|
|
|
|
|
) |
|
|
|
|
@ -1325,12 +1333,6 @@ finit() {
|
|
|
|
|
--text="RetroDECK is finishing the initial setup process, please wait."
|
|
|
|
|
|
|
|
|
|
create_lock
|
|
|
|
|
|
|
|
|
|
zenity --icon-name=net.retrodeck.retrodeck --info --no-wrap \
|
|
|
|
|
--window-icon="/app/share/icons/hicolor/scalable/apps/net.retrodeck.retrodeck.svg" \
|
|
|
|
|
--title "RetroDECK" \
|
|
|
|
|
--text="Installation completed.\nPlease put your roms in:\n\n$roms_folder\n\nand your bioses in\n\n$bios_folder\n\nThen start the program again.\nIf you wish to change the roms location, you may use the tool located the tools section of RetroDECK.\n\nIMPORTANT NOTES:\n- RetroDECK must be manually added and launched from your Steam Library in order to work correctly.\n- It's recommended to use the 'RetroDECK Offical Controller Config' from Steam (under community layouts).\n- It's suggested to use BoilR to automatically add the SteamGridDB images to Steam (this will be automated soon).\nhttps://github.com/PhilipK/BoilR"
|
|
|
|
|
# TODO: Replace the stuff above with BoilR code when ready
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#=========================
|
|
|
|
|