From 33729c51430689d2401694c75acc01ff2d32a8e3 Mon Sep 17 00:00:00 2001 From: MasterZK Date: Tue, 23 Sep 2025 16:42:40 +0200 Subject: Added Lutris Steam shortcut support Added Exe path detection for games added as steam shortcut in lutris --- defaults/assets/fgmod-uninstaller.sh | 35 +++++++++++++++++++++++++++++++++++ defaults/assets/fgmod.sh | 35 +++++++++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 71 insertions(+), 1 deletion(-) diff --git a/defaults/assets/fgmod-uninstaller.sh b/defaults/assets/fgmod-uninstaller.sh index ba32d23..7590120 100755 --- a/defaults/assets/fgmod-uninstaller.sh +++ b/defaults/assets/fgmod-uninstaller.sh @@ -43,6 +43,41 @@ else done fi +for arg in "$@"; do + if [[ "$arg" == lutris:rungameid/* ]]; then + lutris_id="${arg#lutris:rungameid/}" + + # Get slug from Lutris JSON + slug=$(lutris --list-games --json 2>/dev/null | jq -r ".[] | select(.id == $lutris_id) | .slug") + + if [[ -z "$slug" || "$slug" == "null" ]]; then + echo "Could not find slug for Lutris ID $lutris_id" + break + fi + + # Find matching YAML file using slug + config_file=$(find ~/.config/lutris/games/ -iname "${slug}-*.yml" | head -1) + + if [[ -z "$config_file" ]]; then + echo "No config file found for slug '$slug'" + break + fi + + # Extract executable path from YAML + exe_path=$(grep -E '^\s*exe:' "$config_file" | sed 's/.*exe:[[:space:]]*//') + + if [[ -n "$exe_path" ]]; then + exe_folder_path=$(dirname "$exe_path") + echo "Resolved executable path: $exe_path" + echo "Executable folder: $exe_folder_path" + else + echo "Executable path not found in $config_file" + fi + + break + fi +done + # Fallback to STEAM_COMPAT_INSTALL_PATH when no path was found [[ -z "$exe_folder_path" && -n "$STEAM_COMPAT_INSTALL_PATH" ]] && exe_folder_path="$STEAM_COMPAT_INSTALL_PATH" diff --git a/defaults/assets/fgmod.sh b/defaults/assets/fgmod.sh index d0b2070..ef216cd 100755 --- a/defaults/assets/fgmod.sh +++ b/defaults/assets/fgmod.sh @@ -46,6 +46,41 @@ else done fi +for arg in "$@"; do + if [[ "$arg" == lutris:rungameid/* ]]; then + lutris_id="${arg#lutris:rungameid/}" + + # Get slug from Lutris JSON + slug=$(lutris --list-games --json 2>/dev/null | jq -r ".[] | select(.id == $lutris_id) | .slug") + + if [[ -z "$slug" || "$slug" == "null" ]]; then + echo "Could not find slug for Lutris ID $lutris_id" + break + fi + + # Find matching YAML file using slug + config_file=$(find ~/.config/lutris/games/ -iname "${slug}-*.yml" | head -1) + + if [[ -z "$config_file" ]]; then + echo "No config file found for slug '$slug'" + break + fi + + # Extract executable path from YAML + exe_path=$(grep -E '^\s*exe:' "$config_file" | sed 's/.*exe:[[:space:]]*//') + + if [[ -n "$exe_path" ]]; then + exe_folder_path=$(dirname "$exe_path") + echo "Resolved executable path: $exe_path" + echo "Executable folder: $exe_folder_path" + else + echo "Executable path not found in $config_file" + fi + + break + fi +done + [[ -z "$exe_folder_path" && -n "$STEAM_COMPAT_INSTALL_PATH" ]] && exe_folder_path="$STEAM_COMPAT_INSTALL_PATH" if [[ -d "$exe_folder_path/Engine" ]]; then diff --git a/package.json b/package.json index 7449239..a9e492d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "decky-framegen", - "version": "0.11.16", + "version": "0.11.17", "description": "This plugin installs and manages OptiScaler, a tool that enhances upscaling and enables frame generation in a range of DirectX 12 games.", "type": "module", "scripts": { -- cgit v1.2.3