STEAM_SYNC: migrated launches to .desktop files

This commit is contained in:
XargonWan 2024-09-11 16:01:52 +09:00
parent aadd5b3b7b
commit 80cdbabde6
2 changed files with 14 additions and 10 deletions
config/steam-rom-manager
functions

View file

@ -23,7 +23,7 @@
"appendArgsToExecutable": true "appendArgsToExecutable": true
}, },
"parserInputs": { "parserInputs": {
"glob": "${title}.sh" "glob": "${title}.desktop"
}, },
"titleFromVariable": { "titleFromVariable": {
"limitToGroups": "", "limitToGroups": "",

View file

@ -75,8 +75,8 @@ add_to_steam() {
log d "Sanitized Name: $sanitized_name" log d "Sanitized Name: $sanitized_name"
local launcher="$steamsync_folder/${sanitized_name}.sh" local launcher="$steamsync_folder/${sanitized_name}.desktop"
log d "Creating shortcut at path: $launcher" log d "Creating desktop file: $launcher"
# if [[ -v command_list_default[$system] ]]; then # if [[ -v command_list_default[$system] ]]; then
# command="${command_list_default[$system]}" # command="${command_list_default[$system]}"
@ -88,13 +88,17 @@ add_to_steam() {
# Populate the .sync script with the correct command # Populate the .sync script with the correct command
# TODO: if there is any emulator defined in the xml we use that, else... how we can know which is the default one? # TODO: if there is any emulator defined in the xml we use that, else... how we can know which is the default one?
local command="flatpak run net.retrodeck.retrodeck start -s $system \"$roms_folder/$system/$path\"" local command="flatpak run net.retrodeck.retrodeck start -s $system \"$roms_folder/$system/$path\""
echo -e '#!/bin/bash\n' > "$launcher" cat <<EOF > "$launcher"
echo -e "if [ test \"$(whereis flatpak)\" = \"flatpak:\" ]; then" >> "$launcher" [Desktop Entry]
echo -e "\tflatpak-spawn --host $command" >> "$launcher" Version=1.0
echo -e "else" >> "$launcher" Name=$name
echo -e "\t$command" >> "$launcher" Comment=$name via RetroDECK
echo -e "fi" >> "$launcher" Exec=bash -c 'if [ "\$(whereis flatpak)" = "flatpak:" ]; then flatpak-spawn --host $command; else $command; fi'
Icon=net.retrodeck.retrodeck
Terminal=false
Type=Application
Categories=Game;Emulator;
EOF
chmod +x "$launcher" chmod +x "$launcher"
done done
fi fi