RetroDECK/functions/steam_sync.sh

109 lines
3.7 KiB
Bash
Raw Normal View History

feat/steam-rom-manager (#860) * SRM: adding Steam ROM Manager * SRM: adding electron base * Fixed SRM Fixed launching script of SRM * Updated for srm * Standard config for srm * Update with srm in place of boilr * Update with srm in place of boilr * Added steam-sync option * PREPARE_COMPONENTS: removing spaces from steam rom manager * SRM: adding it ot reset cli, boilr cleanup * SRM: boilr cleanup [skip ci] * Update and fixed script * Modified steam sync works * Update configurator.sh * STEAM_SYNC: fixing gameslist location * SRM: fixed path, whoops * Added file for resetting the configuration * Modified with external reset function * Modified with external reset function * Added msgbox during fav sync * STEAM_SYNC: fixed some texts * Modified if for remove everything if no favorite games * Fixed removing the games when no favs * STEAM_ROM_MANAGER: added to features.json * STEAM_ROM_MANAGER: casing names descriptions * Fixed some error * Moved away the creation of .sync folder * Uploaded standard exception * Added reset userExceptions * Revert missing entrypoint * STEAM_SYNC_SH: checkpoint, addToSteam is working * STEAM_SYNC_SH: fixed bad launcher filename generation * STEAM_SYNC_SH: fixed game names, unified in a single function, code cleanup * STEAM_SYNC_SH: removed deprecated commands [skip ci] * STEAM_SYNC_SH: fixed launcher with correct command [skip ci] * STEAM_SYNC_SH: added prepare_component [skip ci] * STEAM_SYNC_SH: code cleanup [skip ci] * STEAM_SYNC_SH: moved it on retrodeck quit instead of retrodeck start [skip ci] * STEAM_SYNC_SH: updated userConfigurations.json [skip ci] * STEAM_SYNC_SH: code cleanup * Triggering build * STEAM_SYNC: globalized steamsync_folder variable * STEAM_SYNC: standardized script name * STEAM_SYNC: fixing array * STEAM_SYNC: fixing array -part2 * POST_UPDATE: enhanced for steam_rom_manager * STEAM_SYNC: this variable is not correct here * STEAM_SYNC: fixing configuration * STEAM_SYNC: adding more sanitized games cases * STEAM_SYNC: fix framwork was shutting down before steam_sync * MANIFEST: fixed SRM wrapper to accept args * STEAM_SYNC: fixing SRM preparation * STEAM_SYNC: using run_game to build the launchers * STEAM_SYNC: added system to run_game be sure * STEAM_SYNC_SH: removed unused config file * FEATURES: indentation fix * PREPARE_COMPONENT: comments * STEAM_SYNC_SH: general optimization and bugfixes * STEAM_SYNC_SH: migrated launcher to the new run_game * FEATURES: rebased from cooker * FEATURES: fmt [skip ci] * STEAM_SYNC: using new start command + cleanup * STEAM_SYNC: migrated launches to .desktop files * STEAM_SYNC: reverted .desktop files * STEAM_SYNC: romed -s from launcher * STEAM_SYNC: comments for calling quit function [skip ci] * Create file only if does not exists + fixed syntax * Added full shortcut clean * Fixed check if file exists * Added remove no fav game * Fixed comment error and +x chmod --------- Co-authored-by: Lx32 <loxenfabula@gmail.com>
2024-10-28 01:01:44 +00:00
#!/bin/bash
# Function to sanitize strings for filenames
sanitize() {
# Replace sequences of underscores with a single space
echo "$1" | sed -e 's/_\{2,\}/ /g' -e 's/_/ /g' -e 's/:/ -/g' -e 's/&/and/g' -e 's%/%and%g' -e 's/ / /g'
}
feat/steam-rom-manager (#860) * SRM: adding Steam ROM Manager * SRM: adding electron base * Fixed SRM Fixed launching script of SRM * Updated for srm * Standard config for srm * Update with srm in place of boilr * Update with srm in place of boilr * Added steam-sync option * PREPARE_COMPONENTS: removing spaces from steam rom manager * SRM: adding it ot reset cli, boilr cleanup * SRM: boilr cleanup [skip ci] * Update and fixed script * Modified steam sync works * Update configurator.sh * STEAM_SYNC: fixing gameslist location * SRM: fixed path, whoops * Added file for resetting the configuration * Modified with external reset function * Modified with external reset function * Added msgbox during fav sync * STEAM_SYNC: fixed some texts * Modified if for remove everything if no favorite games * Fixed removing the games when no favs * STEAM_ROM_MANAGER: added to features.json * STEAM_ROM_MANAGER: casing names descriptions * Fixed some error * Moved away the creation of .sync folder * Uploaded standard exception * Added reset userExceptions * Revert missing entrypoint * STEAM_SYNC_SH: checkpoint, addToSteam is working * STEAM_SYNC_SH: fixed bad launcher filename generation * STEAM_SYNC_SH: fixed game names, unified in a single function, code cleanup * STEAM_SYNC_SH: removed deprecated commands [skip ci] * STEAM_SYNC_SH: fixed launcher with correct command [skip ci] * STEAM_SYNC_SH: added prepare_component [skip ci] * STEAM_SYNC_SH: code cleanup [skip ci] * STEAM_SYNC_SH: moved it on retrodeck quit instead of retrodeck start [skip ci] * STEAM_SYNC_SH: updated userConfigurations.json [skip ci] * STEAM_SYNC_SH: code cleanup * Triggering build * STEAM_SYNC: globalized steamsync_folder variable * STEAM_SYNC: standardized script name * STEAM_SYNC: fixing array * STEAM_SYNC: fixing array -part2 * POST_UPDATE: enhanced for steam_rom_manager * STEAM_SYNC: this variable is not correct here * STEAM_SYNC: fixing configuration * STEAM_SYNC: adding more sanitized games cases * STEAM_SYNC: fix framwork was shutting down before steam_sync * MANIFEST: fixed SRM wrapper to accept args * STEAM_SYNC: fixing SRM preparation * STEAM_SYNC: using run_game to build the launchers * STEAM_SYNC: added system to run_game be sure * STEAM_SYNC_SH: removed unused config file * FEATURES: indentation fix * PREPARE_COMPONENT: comments * STEAM_SYNC_SH: general optimization and bugfixes * STEAM_SYNC_SH: migrated launcher to the new run_game * FEATURES: rebased from cooker * FEATURES: fmt [skip ci] * STEAM_SYNC: using new start command + cleanup * STEAM_SYNC: migrated launches to .desktop files * STEAM_SYNC: reverted .desktop files * STEAM_SYNC: romed -s from launcher * STEAM_SYNC: comments for calling quit function [skip ci] * Create file only if does not exists + fixed syntax * Added full shortcut clean * Fixed check if file exists * Added remove no fav game * Fixed comment error and +x chmod --------- Co-authored-by: Lx32 <loxenfabula@gmail.com>
2024-10-28 01:01:44 +00:00
add_to_steam() {
feat/steam-rom-manager (#860) * SRM: adding Steam ROM Manager * SRM: adding electron base * Fixed SRM Fixed launching script of SRM * Updated for srm * Standard config for srm * Update with srm in place of boilr * Update with srm in place of boilr * Added steam-sync option * PREPARE_COMPONENTS: removing spaces from steam rom manager * SRM: adding it ot reset cli, boilr cleanup * SRM: boilr cleanup [skip ci] * Update and fixed script * Modified steam sync works * Update configurator.sh * STEAM_SYNC: fixing gameslist location * SRM: fixed path, whoops * Added file for resetting the configuration * Modified with external reset function * Modified with external reset function * Added msgbox during fav sync * STEAM_SYNC: fixed some texts * Modified if for remove everything if no favorite games * Fixed removing the games when no favs * STEAM_ROM_MANAGER: added to features.json * STEAM_ROM_MANAGER: casing names descriptions * Fixed some error * Moved away the creation of .sync folder * Uploaded standard exception * Added reset userExceptions * Revert missing entrypoint * STEAM_SYNC_SH: checkpoint, addToSteam is working * STEAM_SYNC_SH: fixed bad launcher filename generation * STEAM_SYNC_SH: fixed game names, unified in a single function, code cleanup * STEAM_SYNC_SH: removed deprecated commands [skip ci] * STEAM_SYNC_SH: fixed launcher with correct command [skip ci] * STEAM_SYNC_SH: added prepare_component [skip ci] * STEAM_SYNC_SH: code cleanup [skip ci] * STEAM_SYNC_SH: moved it on retrodeck quit instead of retrodeck start [skip ci] * STEAM_SYNC_SH: updated userConfigurations.json [skip ci] * STEAM_SYNC_SH: code cleanup * Triggering build * STEAM_SYNC: globalized steamsync_folder variable * STEAM_SYNC: standardized script name * STEAM_SYNC: fixing array * STEAM_SYNC: fixing array -part2 * POST_UPDATE: enhanced for steam_rom_manager * STEAM_SYNC: this variable is not correct here * STEAM_SYNC: fixing configuration * STEAM_SYNC: adding more sanitized games cases * STEAM_SYNC: fix framwork was shutting down before steam_sync * MANIFEST: fixed SRM wrapper to accept args * STEAM_SYNC: fixing SRM preparation * STEAM_SYNC: using run_game to build the launchers * STEAM_SYNC: added system to run_game be sure * STEAM_SYNC_SH: removed unused config file * FEATURES: indentation fix * PREPARE_COMPONENT: comments * STEAM_SYNC_SH: general optimization and bugfixes * STEAM_SYNC_SH: migrated launcher to the new run_game * FEATURES: rebased from cooker * FEATURES: fmt [skip ci] * STEAM_SYNC: using new start command + cleanup * STEAM_SYNC: migrated launches to .desktop files * STEAM_SYNC: reverted .desktop files * STEAM_SYNC: romed -s from launcher * STEAM_SYNC: comments for calling quit function [skip ci] * Create file only if does not exists + fixed syntax * Added full shortcut clean * Fixed check if file exists * Added remove no fav game * Fixed comment error and +x chmod --------- Co-authored-by: Lx32 <loxenfabula@gmail.com>
2024-10-28 01:01:44 +00:00
log "i" "Starting Steam Sync"
create_dir $steamsync_folder_tmp
feat/steam-rom-manager (#860) * SRM: adding Steam ROM Manager * SRM: adding electron base * Fixed SRM Fixed launching script of SRM * Updated for srm * Standard config for srm * Update with srm in place of boilr * Update with srm in place of boilr * Added steam-sync option * PREPARE_COMPONENTS: removing spaces from steam rom manager * SRM: adding it ot reset cli, boilr cleanup * SRM: boilr cleanup [skip ci] * Update and fixed script * Modified steam sync works * Update configurator.sh * STEAM_SYNC: fixing gameslist location * SRM: fixed path, whoops * Added file for resetting the configuration * Modified with external reset function * Modified with external reset function * Added msgbox during fav sync * STEAM_SYNC: fixed some texts * Modified if for remove everything if no favorite games * Fixed removing the games when no favs * STEAM_ROM_MANAGER: added to features.json * STEAM_ROM_MANAGER: casing names descriptions * Fixed some error * Moved away the creation of .sync folder * Uploaded standard exception * Added reset userExceptions * Revert missing entrypoint * STEAM_SYNC_SH: checkpoint, addToSteam is working * STEAM_SYNC_SH: fixed bad launcher filename generation * STEAM_SYNC_SH: fixed game names, unified in a single function, code cleanup * STEAM_SYNC_SH: removed deprecated commands [skip ci] * STEAM_SYNC_SH: fixed launcher with correct command [skip ci] * STEAM_SYNC_SH: added prepare_component [skip ci] * STEAM_SYNC_SH: code cleanup [skip ci] * STEAM_SYNC_SH: moved it on retrodeck quit instead of retrodeck start [skip ci] * STEAM_SYNC_SH: updated userConfigurations.json [skip ci] * STEAM_SYNC_SH: code cleanup * Triggering build * STEAM_SYNC: globalized steamsync_folder variable * STEAM_SYNC: standardized script name * STEAM_SYNC: fixing array * STEAM_SYNC: fixing array -part2 * POST_UPDATE: enhanced for steam_rom_manager * STEAM_SYNC: this variable is not correct here * STEAM_SYNC: fixing configuration * STEAM_SYNC: adding more sanitized games cases * STEAM_SYNC: fix framwork was shutting down before steam_sync * MANIFEST: fixed SRM wrapper to accept args * STEAM_SYNC: fixing SRM preparation * STEAM_SYNC: using run_game to build the launchers * STEAM_SYNC: added system to run_game be sure * STEAM_SYNC_SH: removed unused config file * FEATURES: indentation fix * PREPARE_COMPONENT: comments * STEAM_SYNC_SH: general optimization and bugfixes * STEAM_SYNC_SH: migrated launcher to the new run_game * FEATURES: rebased from cooker * FEATURES: fmt [skip ci] * STEAM_SYNC: using new start command + cleanup * STEAM_SYNC: migrated launches to .desktop files * STEAM_SYNC: reverted .desktop files * STEAM_SYNC: romed -s from launcher * STEAM_SYNC: comments for calling quit function [skip ci] * Create file only if does not exists + fixed syntax * Added full shortcut clean * Fixed check if file exists * Added remove no fav game * Fixed comment error and +x chmod --------- Co-authored-by: Lx32 <loxenfabula@gmail.com>
2024-10-28 01:01:44 +00:00
local srm_path="/var/config/steam-rom-manager/userData/userConfigurations.json"
if [ ! -f "$srm_path" ]; then
log "e" "Steam ROM Manager configuration not initialized! Initializing now."
prepare_component "reset" "steam-rom-manager"
fi
# Iterate through all gamelist.xml files in the folder structure
for system_path in "$rdhome/ES-DE/gamelists/"*/; do
system=$(basename "$system_path") # Extract the folder name as the system name
gamelist="${system_path}gamelist.xml"
feat/steam-rom-manager (#860) * SRM: adding Steam ROM Manager * SRM: adding electron base * Fixed SRM Fixed launching script of SRM * Updated for srm * Standard config for srm * Update with srm in place of boilr * Update with srm in place of boilr * Added steam-sync option * PREPARE_COMPONENTS: removing spaces from steam rom manager * SRM: adding it ot reset cli, boilr cleanup * SRM: boilr cleanup [skip ci] * Update and fixed script * Modified steam sync works * Update configurator.sh * STEAM_SYNC: fixing gameslist location * SRM: fixed path, whoops * Added file for resetting the configuration * Modified with external reset function * Modified with external reset function * Added msgbox during fav sync * STEAM_SYNC: fixed some texts * Modified if for remove everything if no favorite games * Fixed removing the games when no favs * STEAM_ROM_MANAGER: added to features.json * STEAM_ROM_MANAGER: casing names descriptions * Fixed some error * Moved away the creation of .sync folder * Uploaded standard exception * Added reset userExceptions * Revert missing entrypoint * STEAM_SYNC_SH: checkpoint, addToSteam is working * STEAM_SYNC_SH: fixed bad launcher filename generation * STEAM_SYNC_SH: fixed game names, unified in a single function, code cleanup * STEAM_SYNC_SH: removed deprecated commands [skip ci] * STEAM_SYNC_SH: fixed launcher with correct command [skip ci] * STEAM_SYNC_SH: added prepare_component [skip ci] * STEAM_SYNC_SH: code cleanup [skip ci] * STEAM_SYNC_SH: moved it on retrodeck quit instead of retrodeck start [skip ci] * STEAM_SYNC_SH: updated userConfigurations.json [skip ci] * STEAM_SYNC_SH: code cleanup * Triggering build * STEAM_SYNC: globalized steamsync_folder variable * STEAM_SYNC: standardized script name * STEAM_SYNC: fixing array * STEAM_SYNC: fixing array -part2 * POST_UPDATE: enhanced for steam_rom_manager * STEAM_SYNC: this variable is not correct here * STEAM_SYNC: fixing configuration * STEAM_SYNC: adding more sanitized games cases * STEAM_SYNC: fix framwork was shutting down before steam_sync * MANIFEST: fixed SRM wrapper to accept args * STEAM_SYNC: fixing SRM preparation * STEAM_SYNC: using run_game to build the launchers * STEAM_SYNC: added system to run_game be sure * STEAM_SYNC_SH: removed unused config file * FEATURES: indentation fix * PREPARE_COMPONENT: comments * STEAM_SYNC_SH: general optimization and bugfixes * STEAM_SYNC_SH: migrated launcher to the new run_game * FEATURES: rebased from cooker * FEATURES: fmt [skip ci] * STEAM_SYNC: using new start command + cleanup * STEAM_SYNC: migrated launches to .desktop files * STEAM_SYNC: reverted .desktop files * STEAM_SYNC: romed -s from launcher * STEAM_SYNC: comments for calling quit function [skip ci] * Create file only if does not exists + fixed syntax * Added full shortcut clean * Fixed check if file exists * Added remove no fav game * Fixed comment error and +x chmod --------- Co-authored-by: Lx32 <loxenfabula@gmail.com>
2024-10-28 01:01:44 +00:00
log d "Reading favorites for $system"
feat/steam-rom-manager (#860) * SRM: adding Steam ROM Manager * SRM: adding electron base * Fixed SRM Fixed launching script of SRM * Updated for srm * Standard config for srm * Update with srm in place of boilr * Update with srm in place of boilr * Added steam-sync option * PREPARE_COMPONENTS: removing spaces from steam rom manager * SRM: adding it ot reset cli, boilr cleanup * SRM: boilr cleanup [skip ci] * Update and fixed script * Modified steam sync works * Update configurator.sh * STEAM_SYNC: fixing gameslist location * SRM: fixed path, whoops * Added file for resetting the configuration * Modified with external reset function * Modified with external reset function * Added msgbox during fav sync * STEAM_SYNC: fixed some texts * Modified if for remove everything if no favorite games * Fixed removing the games when no favs * STEAM_ROM_MANAGER: added to features.json * STEAM_ROM_MANAGER: casing names descriptions * Fixed some error * Moved away the creation of .sync folder * Uploaded standard exception * Added reset userExceptions * Revert missing entrypoint * STEAM_SYNC_SH: checkpoint, addToSteam is working * STEAM_SYNC_SH: fixed bad launcher filename generation * STEAM_SYNC_SH: fixed game names, unified in a single function, code cleanup * STEAM_SYNC_SH: removed deprecated commands [skip ci] * STEAM_SYNC_SH: fixed launcher with correct command [skip ci] * STEAM_SYNC_SH: added prepare_component [skip ci] * STEAM_SYNC_SH: code cleanup [skip ci] * STEAM_SYNC_SH: moved it on retrodeck quit instead of retrodeck start [skip ci] * STEAM_SYNC_SH: updated userConfigurations.json [skip ci] * STEAM_SYNC_SH: code cleanup * Triggering build * STEAM_SYNC: globalized steamsync_folder variable * STEAM_SYNC: standardized script name * STEAM_SYNC: fixing array * STEAM_SYNC: fixing array -part2 * POST_UPDATE: enhanced for steam_rom_manager * STEAM_SYNC: this variable is not correct here * STEAM_SYNC: fixing configuration * STEAM_SYNC: adding more sanitized games cases * STEAM_SYNC: fix framwork was shutting down before steam_sync * MANIFEST: fixed SRM wrapper to accept args * STEAM_SYNC: fixing SRM preparation * STEAM_SYNC: using run_game to build the launchers * STEAM_SYNC: added system to run_game be sure * STEAM_SYNC_SH: removed unused config file * FEATURES: indentation fix * PREPARE_COMPONENT: comments * STEAM_SYNC_SH: general optimization and bugfixes * STEAM_SYNC_SH: migrated launcher to the new run_game * FEATURES: rebased from cooker * FEATURES: fmt [skip ci] * STEAM_SYNC: using new start command + cleanup * STEAM_SYNC: migrated launches to .desktop files * STEAM_SYNC: reverted .desktop files * STEAM_SYNC: romed -s from launcher * STEAM_SYNC: comments for calling quit function [skip ci] * Create file only if does not exists + fixed syntax * Added full shortcut clean * Fixed check if file exists * Added remove no fav game * Fixed comment error and +x chmod --------- Co-authored-by: Lx32 <loxenfabula@gmail.com>
2024-10-28 01:01:44 +00:00
# Ensure gamelist.xml exists in the current folder
feat/steam-rom-manager (#860) * SRM: adding Steam ROM Manager * SRM: adding electron base * Fixed SRM Fixed launching script of SRM * Updated for srm * Standard config for srm * Update with srm in place of boilr * Update with srm in place of boilr * Added steam-sync option * PREPARE_COMPONENTS: removing spaces from steam rom manager * SRM: adding it ot reset cli, boilr cleanup * SRM: boilr cleanup [skip ci] * Update and fixed script * Modified steam sync works * Update configurator.sh * STEAM_SYNC: fixing gameslist location * SRM: fixed path, whoops * Added file for resetting the configuration * Modified with external reset function * Modified with external reset function * Added msgbox during fav sync * STEAM_SYNC: fixed some texts * Modified if for remove everything if no favorite games * Fixed removing the games when no favs * STEAM_ROM_MANAGER: added to features.json * STEAM_ROM_MANAGER: casing names descriptions * Fixed some error * Moved away the creation of .sync folder * Uploaded standard exception * Added reset userExceptions * Revert missing entrypoint * STEAM_SYNC_SH: checkpoint, addToSteam is working * STEAM_SYNC_SH: fixed bad launcher filename generation * STEAM_SYNC_SH: fixed game names, unified in a single function, code cleanup * STEAM_SYNC_SH: removed deprecated commands [skip ci] * STEAM_SYNC_SH: fixed launcher with correct command [skip ci] * STEAM_SYNC_SH: added prepare_component [skip ci] * STEAM_SYNC_SH: code cleanup [skip ci] * STEAM_SYNC_SH: moved it on retrodeck quit instead of retrodeck start [skip ci] * STEAM_SYNC_SH: updated userConfigurations.json [skip ci] * STEAM_SYNC_SH: code cleanup * Triggering build * STEAM_SYNC: globalized steamsync_folder variable * STEAM_SYNC: standardized script name * STEAM_SYNC: fixing array * STEAM_SYNC: fixing array -part2 * POST_UPDATE: enhanced for steam_rom_manager * STEAM_SYNC: this variable is not correct here * STEAM_SYNC: fixing configuration * STEAM_SYNC: adding more sanitized games cases * STEAM_SYNC: fix framwork was shutting down before steam_sync * MANIFEST: fixed SRM wrapper to accept args * STEAM_SYNC: fixing SRM preparation * STEAM_SYNC: using run_game to build the launchers * STEAM_SYNC: added system to run_game be sure * STEAM_SYNC_SH: removed unused config file * FEATURES: indentation fix * PREPARE_COMPONENT: comments * STEAM_SYNC_SH: general optimization and bugfixes * STEAM_SYNC_SH: migrated launcher to the new run_game * FEATURES: rebased from cooker * FEATURES: fmt [skip ci] * STEAM_SYNC: using new start command + cleanup * STEAM_SYNC: migrated launches to .desktop files * STEAM_SYNC: reverted .desktop files * STEAM_SYNC: romed -s from launcher * STEAM_SYNC: comments for calling quit function [skip ci] * Create file only if does not exists + fixed syntax * Added full shortcut clean * Fixed check if file exists * Added remove no fav game * Fixed comment error and +x chmod --------- Co-authored-by: Lx32 <loxenfabula@gmail.com>
2024-10-28 01:01:44 +00:00
if [ -f "$gamelist" ]; then
while IFS= read -r line; do
# Detect the start of a <game> block
if [[ "$line" =~ \<game\> ]]; then
to_be_added=false # Reset the flag for a new block
path=""
name=""
fi
# Check for <favorite>true</favorite>
if [[ "$line" =~ \<favorite\>true\<\/favorite\> ]]; then
to_be_added=true
fi
# Extract the <path> and remove leading "./" if present
if [[ "$line" =~ \<path\>(.*)\<\/path\> ]]; then
path="${BASH_REMATCH[1]#./}"
fi
# Extract and sanitize <name>
if [[ "$line" =~ \<name\>(.*)\<\/name\> ]]; then
name=$(sanitize "${BASH_REMATCH[1]}")
fi
# Detect the end of a </game> block
if [[ "$line" =~ \<\/game\> ]]; then
# If the block is meaningful (marked as favorite), generate the launcher
if [ "$to_be_added" = true ] && [ -n "$path" ] && [ -n "$name" ]; then
local launcher="$steamsync_folder/${name}.sh"
local launcher_tmp="$steamsync_folder_tmp/${name}.sh"
# Create the launcher file
if [ ! -e "$launcher_tmp" ]; then
log d "Creating launcher file: $launcher"
command="flatpak run net.retrodeck.retrodeck start '$roms_folder/$system/$path'"
cat <<EOF > "$launcher"
feat/steam-rom-manager (#860) * SRM: adding Steam ROM Manager * SRM: adding electron base * Fixed SRM Fixed launching script of SRM * Updated for srm * Standard config for srm * Update with srm in place of boilr * Update with srm in place of boilr * Added steam-sync option * PREPARE_COMPONENTS: removing spaces from steam rom manager * SRM: adding it ot reset cli, boilr cleanup * SRM: boilr cleanup [skip ci] * Update and fixed script * Modified steam sync works * Update configurator.sh * STEAM_SYNC: fixing gameslist location * SRM: fixed path, whoops * Added file for resetting the configuration * Modified with external reset function * Modified with external reset function * Added msgbox during fav sync * STEAM_SYNC: fixed some texts * Modified if for remove everything if no favorite games * Fixed removing the games when no favs * STEAM_ROM_MANAGER: added to features.json * STEAM_ROM_MANAGER: casing names descriptions * Fixed some error * Moved away the creation of .sync folder * Uploaded standard exception * Added reset userExceptions * Revert missing entrypoint * STEAM_SYNC_SH: checkpoint, addToSteam is working * STEAM_SYNC_SH: fixed bad launcher filename generation * STEAM_SYNC_SH: fixed game names, unified in a single function, code cleanup * STEAM_SYNC_SH: removed deprecated commands [skip ci] * STEAM_SYNC_SH: fixed launcher with correct command [skip ci] * STEAM_SYNC_SH: added prepare_component [skip ci] * STEAM_SYNC_SH: code cleanup [skip ci] * STEAM_SYNC_SH: moved it on retrodeck quit instead of retrodeck start [skip ci] * STEAM_SYNC_SH: updated userConfigurations.json [skip ci] * STEAM_SYNC_SH: code cleanup * Triggering build * STEAM_SYNC: globalized steamsync_folder variable * STEAM_SYNC: standardized script name * STEAM_SYNC: fixing array * STEAM_SYNC: fixing array -part2 * POST_UPDATE: enhanced for steam_rom_manager * STEAM_SYNC: this variable is not correct here * STEAM_SYNC: fixing configuration * STEAM_SYNC: adding more sanitized games cases * STEAM_SYNC: fix framwork was shutting down before steam_sync * MANIFEST: fixed SRM wrapper to accept args * STEAM_SYNC: fixing SRM preparation * STEAM_SYNC: using run_game to build the launchers * STEAM_SYNC: added system to run_game be sure * STEAM_SYNC_SH: removed unused config file * FEATURES: indentation fix * PREPARE_COMPONENT: comments * STEAM_SYNC_SH: general optimization and bugfixes * STEAM_SYNC_SH: migrated launcher to the new run_game * FEATURES: rebased from cooker * FEATURES: fmt [skip ci] * STEAM_SYNC: using new start command + cleanup * STEAM_SYNC: migrated launches to .desktop files * STEAM_SYNC: reverted .desktop files * STEAM_SYNC: romed -s from launcher * STEAM_SYNC: comments for calling quit function [skip ci] * Create file only if does not exists + fixed syntax * Added full shortcut clean * Fixed check if file exists * Added remove no fav game * Fixed comment error and +x chmod --------- Co-authored-by: Lx32 <loxenfabula@gmail.com>
2024-10-28 01:01:44 +00:00
#!/bin/bash
if [ test "\$(whereis flatpak)" = "flatpak:" ]; then
flatpak-spawn --host $command
else
$command
fi
EOF
chmod +x "$launcher"
else
log d "$launcher desktop file already exists"
mv "$launcher_tmp" "$launcher"
fi
fi
# Clean up variables for safety
to_be_added=false
path=""
name=""
fi
done < "$gamelist"
feat/steam-rom-manager (#860) * SRM: adding Steam ROM Manager * SRM: adding electron base * Fixed SRM Fixed launching script of SRM * Updated for srm * Standard config for srm * Update with srm in place of boilr * Update with srm in place of boilr * Added steam-sync option * PREPARE_COMPONENTS: removing spaces from steam rom manager * SRM: adding it ot reset cli, boilr cleanup * SRM: boilr cleanup [skip ci] * Update and fixed script * Modified steam sync works * Update configurator.sh * STEAM_SYNC: fixing gameslist location * SRM: fixed path, whoops * Added file for resetting the configuration * Modified with external reset function * Modified with external reset function * Added msgbox during fav sync * STEAM_SYNC: fixed some texts * Modified if for remove everything if no favorite games * Fixed removing the games when no favs * STEAM_ROM_MANAGER: added to features.json * STEAM_ROM_MANAGER: casing names descriptions * Fixed some error * Moved away the creation of .sync folder * Uploaded standard exception * Added reset userExceptions * Revert missing entrypoint * STEAM_SYNC_SH: checkpoint, addToSteam is working * STEAM_SYNC_SH: fixed bad launcher filename generation * STEAM_SYNC_SH: fixed game names, unified in a single function, code cleanup * STEAM_SYNC_SH: removed deprecated commands [skip ci] * STEAM_SYNC_SH: fixed launcher with correct command [skip ci] * STEAM_SYNC_SH: added prepare_component [skip ci] * STEAM_SYNC_SH: code cleanup [skip ci] * STEAM_SYNC_SH: moved it on retrodeck quit instead of retrodeck start [skip ci] * STEAM_SYNC_SH: updated userConfigurations.json [skip ci] * STEAM_SYNC_SH: code cleanup * Triggering build * STEAM_SYNC: globalized steamsync_folder variable * STEAM_SYNC: standardized script name * STEAM_SYNC: fixing array * STEAM_SYNC: fixing array -part2 * POST_UPDATE: enhanced for steam_rom_manager * STEAM_SYNC: this variable is not correct here * STEAM_SYNC: fixing configuration * STEAM_SYNC: adding more sanitized games cases * STEAM_SYNC: fix framwork was shutting down before steam_sync * MANIFEST: fixed SRM wrapper to accept args * STEAM_SYNC: fixing SRM preparation * STEAM_SYNC: using run_game to build the launchers * STEAM_SYNC: added system to run_game be sure * STEAM_SYNC_SH: removed unused config file * FEATURES: indentation fix * PREPARE_COMPONENT: comments * STEAM_SYNC_SH: general optimization and bugfixes * STEAM_SYNC_SH: migrated launcher to the new run_game * FEATURES: rebased from cooker * FEATURES: fmt [skip ci] * STEAM_SYNC: using new start command + cleanup * STEAM_SYNC: migrated launches to .desktop files * STEAM_SYNC: reverted .desktop files * STEAM_SYNC: romed -s from launcher * STEAM_SYNC: comments for calling quit function [skip ci] * Create file only if does not exists + fixed syntax * Added full shortcut clean * Fixed check if file exists * Added remove no fav game * Fixed comment error and +x chmod --------- Co-authored-by: Lx32 <loxenfabula@gmail.com>
2024-10-28 01:01:44 +00:00
else
log "e" "Gamelist file not found: $gamelist"
feat/steam-rom-manager (#860) * SRM: adding Steam ROM Manager * SRM: adding electron base * Fixed SRM Fixed launching script of SRM * Updated for srm * Standard config for srm * Update with srm in place of boilr * Update with srm in place of boilr * Added steam-sync option * PREPARE_COMPONENTS: removing spaces from steam rom manager * SRM: adding it ot reset cli, boilr cleanup * SRM: boilr cleanup [skip ci] * Update and fixed script * Modified steam sync works * Update configurator.sh * STEAM_SYNC: fixing gameslist location * SRM: fixed path, whoops * Added file for resetting the configuration * Modified with external reset function * Modified with external reset function * Added msgbox during fav sync * STEAM_SYNC: fixed some texts * Modified if for remove everything if no favorite games * Fixed removing the games when no favs * STEAM_ROM_MANAGER: added to features.json * STEAM_ROM_MANAGER: casing names descriptions * Fixed some error * Moved away the creation of .sync folder * Uploaded standard exception * Added reset userExceptions * Revert missing entrypoint * STEAM_SYNC_SH: checkpoint, addToSteam is working * STEAM_SYNC_SH: fixed bad launcher filename generation * STEAM_SYNC_SH: fixed game names, unified in a single function, code cleanup * STEAM_SYNC_SH: removed deprecated commands [skip ci] * STEAM_SYNC_SH: fixed launcher with correct command [skip ci] * STEAM_SYNC_SH: added prepare_component [skip ci] * STEAM_SYNC_SH: code cleanup [skip ci] * STEAM_SYNC_SH: moved it on retrodeck quit instead of retrodeck start [skip ci] * STEAM_SYNC_SH: updated userConfigurations.json [skip ci] * STEAM_SYNC_SH: code cleanup * Triggering build * STEAM_SYNC: globalized steamsync_folder variable * STEAM_SYNC: standardized script name * STEAM_SYNC: fixing array * STEAM_SYNC: fixing array -part2 * POST_UPDATE: enhanced for steam_rom_manager * STEAM_SYNC: this variable is not correct here * STEAM_SYNC: fixing configuration * STEAM_SYNC: adding more sanitized games cases * STEAM_SYNC: fix framwork was shutting down before steam_sync * MANIFEST: fixed SRM wrapper to accept args * STEAM_SYNC: fixing SRM preparation * STEAM_SYNC: using run_game to build the launchers * STEAM_SYNC: added system to run_game be sure * STEAM_SYNC_SH: removed unused config file * FEATURES: indentation fix * PREPARE_COMPONENT: comments * STEAM_SYNC_SH: general optimization and bugfixes * STEAM_SYNC_SH: migrated launcher to the new run_game * FEATURES: rebased from cooker * FEATURES: fmt [skip ci] * STEAM_SYNC: using new start command + cleanup * STEAM_SYNC: migrated launches to .desktop files * STEAM_SYNC: reverted .desktop files * STEAM_SYNC: romed -s from launcher * STEAM_SYNC: comments for calling quit function [skip ci] * Create file only if does not exists + fixed syntax * Added full shortcut clean * Fixed check if file exists * Added remove no fav game * Fixed comment error and +x chmod --------- Co-authored-by: Lx32 <loxenfabula@gmail.com>
2024-10-28 01:01:44 +00:00
fi
done
feat/steam-rom-manager (#860) * SRM: adding Steam ROM Manager * SRM: adding electron base * Fixed SRM Fixed launching script of SRM * Updated for srm * Standard config for srm * Update with srm in place of boilr * Update with srm in place of boilr * Added steam-sync option * PREPARE_COMPONENTS: removing spaces from steam rom manager * SRM: adding it ot reset cli, boilr cleanup * SRM: boilr cleanup [skip ci] * Update and fixed script * Modified steam sync works * Update configurator.sh * STEAM_SYNC: fixing gameslist location * SRM: fixed path, whoops * Added file for resetting the configuration * Modified with external reset function * Modified with external reset function * Added msgbox during fav sync * STEAM_SYNC: fixed some texts * Modified if for remove everything if no favorite games * Fixed removing the games when no favs * STEAM_ROM_MANAGER: added to features.json * STEAM_ROM_MANAGER: casing names descriptions * Fixed some error * Moved away the creation of .sync folder * Uploaded standard exception * Added reset userExceptions * Revert missing entrypoint * STEAM_SYNC_SH: checkpoint, addToSteam is working * STEAM_SYNC_SH: fixed bad launcher filename generation * STEAM_SYNC_SH: fixed game names, unified in a single function, code cleanup * STEAM_SYNC_SH: removed deprecated commands [skip ci] * STEAM_SYNC_SH: fixed launcher with correct command [skip ci] * STEAM_SYNC_SH: added prepare_component [skip ci] * STEAM_SYNC_SH: code cleanup [skip ci] * STEAM_SYNC_SH: moved it on retrodeck quit instead of retrodeck start [skip ci] * STEAM_SYNC_SH: updated userConfigurations.json [skip ci] * STEAM_SYNC_SH: code cleanup * Triggering build * STEAM_SYNC: globalized steamsync_folder variable * STEAM_SYNC: standardized script name * STEAM_SYNC: fixing array * STEAM_SYNC: fixing array -part2 * POST_UPDATE: enhanced for steam_rom_manager * STEAM_SYNC: this variable is not correct here * STEAM_SYNC: fixing configuration * STEAM_SYNC: adding more sanitized games cases * STEAM_SYNC: fix framwork was shutting down before steam_sync * MANIFEST: fixed SRM wrapper to accept args * STEAM_SYNC: fixing SRM preparation * STEAM_SYNC: using run_game to build the launchers * STEAM_SYNC: added system to run_game be sure * STEAM_SYNC_SH: removed unused config file * FEATURES: indentation fix * PREPARE_COMPONENT: comments * STEAM_SYNC_SH: general optimization and bugfixes * STEAM_SYNC_SH: migrated launcher to the new run_game * FEATURES: rebased from cooker * FEATURES: fmt [skip ci] * STEAM_SYNC: using new start command + cleanup * STEAM_SYNC: migrated launches to .desktop files * STEAM_SYNC: reverted .desktop files * STEAM_SYNC: romed -s from launcher * STEAM_SYNC: comments for calling quit function [skip ci] * Create file only if does not exists + fixed syntax * Added full shortcut clean * Fixed check if file exists * Added remove no fav game * Fixed comment error and +x chmod --------- Co-authored-by: Lx32 <loxenfabula@gmail.com>
2024-10-28 01:01:44 +00:00
rm -r $steamsync_folder_tmp
feat/steam-rom-manager (#860) * SRM: adding Steam ROM Manager * SRM: adding electron base * Fixed SRM Fixed launching script of SRM * Updated for srm * Standard config for srm * Update with srm in place of boilr * Update with srm in place of boilr * Added steam-sync option * PREPARE_COMPONENTS: removing spaces from steam rom manager * SRM: adding it ot reset cli, boilr cleanup * SRM: boilr cleanup [skip ci] * Update and fixed script * Modified steam sync works * Update configurator.sh * STEAM_SYNC: fixing gameslist location * SRM: fixed path, whoops * Added file for resetting the configuration * Modified with external reset function * Modified with external reset function * Added msgbox during fav sync * STEAM_SYNC: fixed some texts * Modified if for remove everything if no favorite games * Fixed removing the games when no favs * STEAM_ROM_MANAGER: added to features.json * STEAM_ROM_MANAGER: casing names descriptions * Fixed some error * Moved away the creation of .sync folder * Uploaded standard exception * Added reset userExceptions * Revert missing entrypoint * STEAM_SYNC_SH: checkpoint, addToSteam is working * STEAM_SYNC_SH: fixed bad launcher filename generation * STEAM_SYNC_SH: fixed game names, unified in a single function, code cleanup * STEAM_SYNC_SH: removed deprecated commands [skip ci] * STEAM_SYNC_SH: fixed launcher with correct command [skip ci] * STEAM_SYNC_SH: added prepare_component [skip ci] * STEAM_SYNC_SH: code cleanup [skip ci] * STEAM_SYNC_SH: moved it on retrodeck quit instead of retrodeck start [skip ci] * STEAM_SYNC_SH: updated userConfigurations.json [skip ci] * STEAM_SYNC_SH: code cleanup * Triggering build * STEAM_SYNC: globalized steamsync_folder variable * STEAM_SYNC: standardized script name * STEAM_SYNC: fixing array * STEAM_SYNC: fixing array -part2 * POST_UPDATE: enhanced for steam_rom_manager * STEAM_SYNC: this variable is not correct here * STEAM_SYNC: fixing configuration * STEAM_SYNC: adding more sanitized games cases * STEAM_SYNC: fix framwork was shutting down before steam_sync * MANIFEST: fixed SRM wrapper to accept args * STEAM_SYNC: fixing SRM preparation * STEAM_SYNC: using run_game to build the launchers * STEAM_SYNC: added system to run_game be sure * STEAM_SYNC_SH: removed unused config file * FEATURES: indentation fix * PREPARE_COMPONENT: comments * STEAM_SYNC_SH: general optimization and bugfixes * STEAM_SYNC_SH: migrated launcher to the new run_game * FEATURES: rebased from cooker * FEATURES: fmt [skip ci] * STEAM_SYNC: using new start command + cleanup * STEAM_SYNC: migrated launches to .desktop files * STEAM_SYNC: reverted .desktop files * STEAM_SYNC: romed -s from launcher * STEAM_SYNC: comments for calling quit function [skip ci] * Create file only if does not exists + fixed syntax * Added full shortcut clean * Fixed check if file exists * Added remove no fav game * Fixed comment error and +x chmod --------- Co-authored-by: Lx32 <loxenfabula@gmail.com>
2024-10-28 01:01:44 +00:00
if [ -z "$( ls -A $steamsync_folder )" ]; then
log d "No games found, cleaning shortcut"
remove_from_steam
else
log d "Updating game list"
steam-rom-manager add
fi
feat/steam-rom-manager (#860) * SRM: adding Steam ROM Manager * SRM: adding electron base * Fixed SRM Fixed launching script of SRM * Updated for srm * Standard config for srm * Update with srm in place of boilr * Update with srm in place of boilr * Added steam-sync option * PREPARE_COMPONENTS: removing spaces from steam rom manager * SRM: adding it ot reset cli, boilr cleanup * SRM: boilr cleanup [skip ci] * Update and fixed script * Modified steam sync works * Update configurator.sh * STEAM_SYNC: fixing gameslist location * SRM: fixed path, whoops * Added file for resetting the configuration * Modified with external reset function * Modified with external reset function * Added msgbox during fav sync * STEAM_SYNC: fixed some texts * Modified if for remove everything if no favorite games * Fixed removing the games when no favs * STEAM_ROM_MANAGER: added to features.json * STEAM_ROM_MANAGER: casing names descriptions * Fixed some error * Moved away the creation of .sync folder * Uploaded standard exception * Added reset userExceptions * Revert missing entrypoint * STEAM_SYNC_SH: checkpoint, addToSteam is working * STEAM_SYNC_SH: fixed bad launcher filename generation * STEAM_SYNC_SH: fixed game names, unified in a single function, code cleanup * STEAM_SYNC_SH: removed deprecated commands [skip ci] * STEAM_SYNC_SH: fixed launcher with correct command [skip ci] * STEAM_SYNC_SH: added prepare_component [skip ci] * STEAM_SYNC_SH: code cleanup [skip ci] * STEAM_SYNC_SH: moved it on retrodeck quit instead of retrodeck start [skip ci] * STEAM_SYNC_SH: updated userConfigurations.json [skip ci] * STEAM_SYNC_SH: code cleanup * Triggering build * STEAM_SYNC: globalized steamsync_folder variable * STEAM_SYNC: standardized script name * STEAM_SYNC: fixing array * STEAM_SYNC: fixing array -part2 * POST_UPDATE: enhanced for steam_rom_manager * STEAM_SYNC: this variable is not correct here * STEAM_SYNC: fixing configuration * STEAM_SYNC: adding more sanitized games cases * STEAM_SYNC: fix framwork was shutting down before steam_sync * MANIFEST: fixed SRM wrapper to accept args * STEAM_SYNC: fixing SRM preparation * STEAM_SYNC: using run_game to build the launchers * STEAM_SYNC: added system to run_game be sure * STEAM_SYNC_SH: removed unused config file * FEATURES: indentation fix * PREPARE_COMPONENT: comments * STEAM_SYNC_SH: general optimization and bugfixes * STEAM_SYNC_SH: migrated launcher to the new run_game * FEATURES: rebased from cooker * FEATURES: fmt [skip ci] * STEAM_SYNC: using new start command + cleanup * STEAM_SYNC: migrated launches to .desktop files * STEAM_SYNC: reverted .desktop files * STEAM_SYNC: romed -s from launcher * STEAM_SYNC: comments for calling quit function [skip ci] * Create file only if does not exists + fixed syntax * Added full shortcut clean * Fixed check if file exists * Added remove no fav game * Fixed comment error and +x chmod --------- Co-authored-by: Lx32 <loxenfabula@gmail.com>
2024-10-28 01:01:44 +00:00
}
remove_from_steam() {
log d "Creating fake game"
cat "" > "$steamsync_folder/CUL0.sh"
log d "Cleaning the shortcut"
steam-rom-manager remove
log d "Removing fake game"
rm "$steamsync_folder/CUL0.sh"
}