diff options
| author | Grimbakor <davidstur@gmail.com> | 2025-01-30 17:11:32 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-30 12:11:32 -0500 |
| commit | 00d16976e6ff5257066c24fe819d479f324db215 (patch) | |
| tree | c5587c9c9e52f90fef22d050543162111bbacb14 | |
| parent | 13de57fb692ac9f15646ece6d25a33fe936beb4f (diff) | |
| download | Decky-Framegen-00d16976e6ff5257066c24fe819d479f324db215.tar.gz Decky-Framegen-00d16976e6ff5257066c24fe819d479f324db215.zip | |
* Move assets/ to defaults/assets so .vscode/build.sh and decky-cli packages correctly (#28)v0.5.0-Bundled
* Changed all paths to use environment variables from decky as base paths
* Remove alwaysRender from front-end so setInterval does not run in the
background during a game session
| -rw-r--r-- | deck.json | 7 | ||||
| -rw-r--r-- | defaults/assets/fgmod-remover.sh (renamed from assets/fgmod-remover.sh) | 0 | ||||
| -rwxr-xr-x | defaults/assets/fgmod-uninstaller.sh (renamed from assets/fgmod-uninstaller.sh) | 0 | ||||
| -rwxr-xr-x | defaults/assets/fgmod.sh (renamed from assets/fgmod.sh) | 0 | ||||
| -rwxr-xr-x | defaults/assets/prepare.sh (renamed from assets/prepare.sh) | 0 | ||||
| -rw-r--r-- | main.py | 18 | ||||
| -rwxr-xr-x | src/index.tsx | 72 |
7 files changed, 18 insertions, 79 deletions
diff --git a/deck.json b/deck.json new file mode 100644 index 0000000..2e2491e --- /dev/null +++ b/deck.json @@ -0,0 +1,7 @@ +{ + "deckip": "0.0.0.0", + "deckport": "22", + "deckpass": "ssap", + "deckkey": "-i $HOME/.ssh/id_rsa", + "deckdir": "/home/deck" +}
\ No newline at end of file diff --git a/assets/fgmod-remover.sh b/defaults/assets/fgmod-remover.sh index 1d12a18..1d12a18 100644 --- a/assets/fgmod-remover.sh +++ b/defaults/assets/fgmod-remover.sh diff --git a/assets/fgmod-uninstaller.sh b/defaults/assets/fgmod-uninstaller.sh index 7bff63a..7bff63a 100755 --- a/assets/fgmod-uninstaller.sh +++ b/defaults/assets/fgmod-uninstaller.sh diff --git a/assets/fgmod.sh b/defaults/assets/fgmod.sh index dad2a41..dad2a41 100755 --- a/assets/fgmod.sh +++ b/defaults/assets/fgmod.sh diff --git a/assets/prepare.sh b/defaults/assets/prepare.sh index a48ffcb..a48ffcb 100755 --- a/assets/prepare.sh +++ b/defaults/assets/prepare.sh @@ -14,7 +14,7 @@ class Plugin: async def run_uninstall_fgmod(self) -> dict: try: result = subprocess.run( - ["/bin/bash", Path.home() / "homebrew" / "plugins" / "Decky-Framegen" / "assets" / "fgmod-remover.sh"], + ["/bin/bash", Path(decky.DECKY_PLUGIN_DIR) / "assets" / "fgmod-remover.sh"], capture_output=True, text=True, check=True @@ -25,8 +25,8 @@ class Plugin: async def run_install_fgmod(self) -> dict: try: - assets_dir = Path.home() / "homebrew" / "plugins" / "Decky-Framegen" / "assets" - downloads_dir = Path.home() / "Downloads" + assets_dir = Path(decky.DECKY_PLUGIN_DIR) / "assets" + downloads_dir = Path(decky.HOME) / "Downloads" if not assets_dir.exists(): decky.logger.error(f"Assets directory not found: {assets_dir}") @@ -59,7 +59,7 @@ class Plugin: timeout=300 ) - fgmod_path = Path.home() / "fgmod" + fgmod_path = Path(decky.HOME) / "fgmod" fgmod_path.mkdir(parents=True, exist_ok=True) decky.logger.info(f"Script output:\n{process.stdout}") @@ -97,7 +97,7 @@ class Plugin: } async def check_fgmod_path(self) -> dict: - path = Path.home() / "fgmod" + path = Path(decky.HOME) / "fgmod" required_files = [ "amd_fidelityfx_dx12.dll", "dlssg_to_fsr3_amd_is_better.dll", "libxess.dll", "amd_fidelityfx_vk.dll", "dlssg_to_fsr3.ini", "licenses", @@ -108,9 +108,9 @@ class Plugin: "dlssg_to_fsr3_amd_is_better-3.0.dll", "fgmod-uninstaller.sh", "RestoreNvidiaSignatureChecks.reg" ] - if os.path.exists(path): + if path.exists(): for file_name in required_files: - if not os.path.exists(os.path.join(path, file_name)): + if not path.joinpath(file_name).exists(): return {"exists": False} return {"exists": True} else: @@ -119,7 +119,7 @@ class Plugin: # New method to list installed Steam games async def list_installed_games(self) -> dict: try: - steam_root = Path.home() / ".steam" / "steam" + steam_root = Path(decky.HOME) / ".steam" / "steam" library_file = Path(steam_root) / "steamapps" / "libraryfolders.vdf" if not library_file.exists(): @@ -156,4 +156,4 @@ class Plugin: return {"status": "success", "games": filtered_games} except Exception as e: - return {"status": "error", "message": str(e)}
\ No newline at end of file + return {"status": "error", "message": str(e)} diff --git a/src/index.tsx b/src/index.tsx index 7152951..851e003 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -162,74 +162,6 @@ function FGModInstallerSection() { ); } -// function MainRunningApp() { -// const mainRunningApp = Router.MainRunningApp; -// const [result, setResult] = useState<string | null>(null); -// const [isPatched, setIsPatched] = useState<boolean>(false); - -// const checkLaunchOptions = async () => { -// if (mainRunningApp) { -// try { -// const currentOptions = await SteamClient.Apps.GetLaunchOptionsForApp(mainRunningApp.appid); -// setIsPatched(currentOptions.includes('~/fgmod/fgmod %COMMAND%')); -// } catch (error) { -// console.error('Error checking launch options:', error); -// } -// } -// }; - -// useEffect(() => { -// if (mainRunningApp) { -// checkLaunchOptions(); -// } -// }, [mainRunningApp]); - -// const handleSetLaunchOptions = async () => { -// if (mainRunningApp) { -// try { -// if (isPatched) { -// await SteamClient.Apps.SetAppLaunchOptions(mainRunningApp.appid, ''); -// setResult(`Launch options cleared successfully. Restart the game to restore DLSS default files`); -// } else { -// await SteamClient.Apps.SetAppLaunchOptions(mainRunningApp.appid, '~/fgmod/fgmod %COMMAND%'); -// setResult(`Launch options set successfully, restart the game to use FSR upscaling and frame gen via DLSS options.`); -// } -// setIsPatched(!isPatched); -// } catch (error) { -// if (error instanceof Error) { -// setResult(`Error setting launch options: ${error.message}`); -// } else { -// setResult('Error setting launch options'); -// } -// } -// } -// }; - -// return ( -// <PanelSection title="Game Patcher"> -// <PanelSectionRow> -// <div> -// {mainRunningApp ? ( -// <> -// <span>{isPatched ? `UnPatch: ${mainRunningApp.display_name}` : `Patch: ${mainRunningApp.display_name}`}</span> -// <ButtonItem layout="below" onClick={handleSetLaunchOptions}> -// {isPatched ? `UnPatch: ${mainRunningApp.display_name}` : `Patch: ${mainRunningApp.display_name}`} -// </ButtonItem> -// </> -// ) : ( -// <span>No game is currently open.</span> -// )} -// </div> -// </PanelSectionRow> -// {result && ( -// <PanelSectionRow> -// <div>{result}</div> -// </PanelSectionRow> -// )} -// </PanelSection> -// ); -// } - function InstalledGamesSection() { const [games, setGames] = useState<{ appid: number; name: string }[]>([]); const [clickedGame, setClickedGame] = useState<{ appid: number; name: string } | null>(null); @@ -319,7 +251,7 @@ function InstalledGamesSection() { export default definePlugin(() => ({ name: "Framegen Plugin", titleView: <div>Decky Framegen</div>, - alwaysRender: true, + alwaysRender: false, content: ( <> <FGModInstallerSection /> @@ -339,4 +271,4 @@ function MainContent() { {} </> ); -}
\ No newline at end of file +} |
