This commit is contained in:
Dragoon Dorise 2025-04-11 23:48:34 +02:00
commit 5643375a61

View File

@ -44,8 +44,13 @@ if [[ $fileExtension == "desktop" ]]; then
# this removes everything in Exec= line before first " or ' (quotes), keeps everything after that (including the quotes)
# given example above, result will be: "/run/media/mmcblk0p1/Emulation/storage/shadps4/games/CUSA01369/eboot.bin"
launchParam=$(echo "Exec=$shadps4DesktopExec" | sed "s|^\(Exec=\)[^\"\']*\([\"\']\)|\2|")
launchParam=$(echo "$shadps4DesktopExec" | grep -oP '"\K[^"]+(?=")')
# fallback : si pas trouvé avec guillemets, prend dernier mot
if [[ -z "$launchParam" ]]; then
launchParam=$(echo "$shadps4DesktopExec" | awk '{print $NF}')
fi
# construct launch args and run
launch_args=("-g" "$launchParam")
echo "Launching: ${exe[*]} ${launch_args[*]}"