Merge branch 'feat/steam-rom-manager' of https://github.com/RetroDECK/RetroDECK into feat/okonomiyaki

This commit is contained in:
XargonWan 2024-09-25 17:06:21 +09:00
commit a60ea83250

View file

@ -6,6 +6,9 @@ add_to_steam() {
log "i" "Starting Steam Sync"
steamsync_folder="$rdhome/.sync"
steamsync_folder_tmp="$rdhome/.sync-tmp"
create_dir $steamsync_folder
mv $steamsync_folder $steamsync_folder_tmp
create_dir $steamsync_folder
local srm_path="/var/config/steam-rom-manager/userData/userConfigurations.json"
@ -76,6 +79,10 @@ add_to_steam() {
log d "Sanitized Name: $sanitized_name"
local launcher="$steamsync_folder/${sanitized_name}.sh"
local launcher_tmp="$steamsync_folder_tmp/${sanitized_name}.sh"
if [ ! -e "$launcher_tmp" ]; then
log d "Creating desktop file: $launcher"
# if [[ -v command_list_default[$system] ]]; then
@ -103,19 +110,38 @@ add_to_steam() {
# EOF
cat <<EOF > "$launcher"
#!/bin/bash
if [ test "$(whereis flatpak)" = "flatpak:" ]; then
if [ test "\$(whereis flatpak)" = "flatpak:" ]; then
flatpak-spawn --host $command
else
$command
fi
EOF
else
log d "$launcher desktop file already exists"
mv "$launcher_tmp" "$launcher"
fi
done
fi
done
steam-rom-manager add
rm -r $steamsync_folder_tmp
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
log i "Steam Sync: completed"
}
remove_from_steam() {
echo "TBD"
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"
}