-
-
Notifications
You must be signed in to change notification settings - Fork 218
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49e097a
commit 245502a
Showing
2 changed files
with
66 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
source $HOME/.config/EmuDeck/backend/functions/all.sh | ||
emulatorInit "shadps4" | ||
emuName="ShadPS4" #parameterize me | ||
emufolder="$HOME/Applications/publish" # has to be here for ES-DE to find it | ||
|
||
#initialize execute array | ||
exe=() | ||
|
||
#find full path to emu executable | ||
exe_path=$(find "$emufolder" -iname "${emuName}.sh" | sort -n | cut -d' ' -f 2- | tail -n 1 2>/dev/null) | ||
|
||
#if appimage doesn't exist fall back to flatpak. | ||
if [[ -z "$exe_path" ]]; then | ||
#flatpak | ||
flatpakApp=$(flatpak list --app --columns=application | grep "$emuName") | ||
#fill execute array | ||
exe=("flatpak" "run" "$flatpakApp") | ||
else | ||
#make sure that file is executable | ||
chmod +x "$exe_path" | ||
#fill execute array | ||
exe=("$exe_path") | ||
fi | ||
|
||
#run the executable with the params. | ||
launch_args=() | ||
for rom in "${@}"; do | ||
# Parsers previously had single quotes ("'/path/to/rom'" ), this allows those shortcuts to continue working. | ||
removedLegacySingleQuotes=$(echo "$rom" | sed "s/^'//; s/'$//") | ||
launch_args+=("$removedLegacySingleQuotes") | ||
done | ||
|
||
echo "Launching: ${exe[*]} ${launch_args[*]}" | ||
|
||
if [[ -z "${*}" ]]; then | ||
echo "ROM not found. Launching $emuName directly" | ||
"${exe[@]}" | ||
else | ||
echo "ROM found, launching game" | ||
"${exe[@]}" "${launch_args[@]}" | ||
fi | ||
|
||
rm -rf "$savesPath/.gaming" |