diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2026-09-10 14:59:56 -0400 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2026-09-10 14:59:56 -0400 |
| commit | be1feeee76cf4956bc5456e4b2740930750fbedf (patch) | |
| tree | 32f08835271fd92f99d6be699bf7cbde81a2060c /src | |
| parent | 1e97e741ae89270801526234e3caaf5c7aacdca7 (diff) | |
| download | decky-lsfg-vk-be1feeee76cf4956bc5456e4b2740930750fbedf.tar.gz decky-lsfg-vk-be1feeee76cf4956bc5456e4b2740930750fbedf.zip | |
fix: recognize split Steam Flatpak targets
Diffstat (limited to 'src')
| -rw-r--r-- | src/hooks/useGameConfiguration.ts | 12 | ||||
| -rw-r--r-- | src/utils/steamLaunchOptions.ts | 10 |
2 files changed, 17 insertions, 5 deletions
diff --git a/src/hooks/useGameConfiguration.ts b/src/hooks/useGameConfiguration.ts index a3976a0..b2867b3 100644 --- a/src/hooks/useGameConfiguration.ts +++ b/src/hooks/useGameConfiguration.ts @@ -3,13 +3,16 @@ import { useQuickAccessVisible } from "@decky/api"; import { Router } from "@decky/ui"; import { getGameConfigs, getInstalledGames, getWorkaroundState, removeWorkaroundState, resetGameConfig, resetAllGameConfigs, setWorkaroundState, updateGameConfig, type GameConfigEntry, type GlobalConfig, type InstalledGame, type WorkaroundState } from "../api/lsfgApi"; import { ConfigurationData, getDefaults } from "../config/configSchema"; -import { getDefaultWrapperPath, installWrapperIntegration, removeWrapperIntegration } from "../utils/steamLaunchOptions"; +import { getDefaultWrapperPath, installWrapperIntegration, normalizeShortcutTarget, removeWrapperIntegration } from "../utils/steamLaunchOptions"; import { showErrorToast } from "../utils/toastUtils"; export interface GameTarget extends InstalledGame { configured: boolean; } -function shortcutTransport(executable: unknown): InstalledGame["transport"] { - const target = typeof executable === "string" ? executable.trim() : ""; +function shortcutTransport(executable: unknown, startDir: unknown): InstalledGame["transport"] { + const target = normalizeShortcutTarget( + typeof executable === "string" ? executable : undefined, + typeof startDir === "string" ? startDir : undefined, + ); return target === "/usr/bin/flatpak" || target === '"~/.lsfg" "/usr/bin/flatpak"' || target === "~/.lsfg /usr/bin/flatpak" @@ -29,11 +32,12 @@ async function getSteamShortcuts(): Promise<InstalledGame[]> { const name = shortcut?.data?.strAppName; if (!Number.isInteger(appid) || appid === 0 || typeof name !== "string" || !name) return []; const executable = shortcut?.data?.strShortcutExe ?? shortcut?.data?.strExe ?? shortcut?.data?.exe; + const startDir = shortcut?.data?.strShortcutStartDir ?? shortcut?.data?.strStartDir ?? shortcut?.data?.startDir; return [{ appid: String(appid >>> 0), name, nonSteam: true, - transport: shortcutTransport(executable), + transport: shortcutTransport(executable, startDir), }]; }); } catch { diff --git a/src/utils/steamLaunchOptions.ts b/src/utils/steamLaunchOptions.ts index bcd69d0..9f88a9f 100644 --- a/src/utils/steamLaunchOptions.ts +++ b/src/utils/steamLaunchOptions.ts @@ -57,12 +57,20 @@ function timer() { }; } +export function normalizeShortcutTarget(executable?: string | null, startDir?: string | null): string { + const target = typeof executable === "string" ? executable.trim() : ""; + const normalizedStartDir = typeof startDir === "string" ? startDir.trim().replace(/\/+$/, "") : ""; + return target === "flatpak" && normalizedStartDir === "/usr/bin" + ? DIRECT_FLATPAK_EXECUTABLE + : target; +} + function snapshot(appId: number, nonSteam: boolean, details: SteamAppDetails): SteamLaunchOptionsSnapshot { return { appId, nonSteam, options: nonSteam ? details.strShortcutLaunchOptions || "" : details.strLaunchOptions || "", - target: nonSteam ? details.strShortcutExe || "" : "", + target: nonSteam ? normalizeShortcutTarget(details.strShortcutExe, details.strShortcutStartDir) : "", details, }; } |
