summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>2025-07-30 12:55:00 -0700
committerGitHub <noreply@github.com>2025-07-30 12:55:00 -0700
commitda9c3c8ec04933e921cce0929734a096b7e544fc (patch)
tree808580ac03d3a2815055b4ed219562e7affd16df
parentb04fa027f7291710359bb6c4a8c1d0ebb85d53e5 (diff)
parente8dc90a60ff4d9da00397dd8dbdff72bae0e9359 (diff)
downloaddecky-lsfg-vk-da9c3c8ec04933e921cce0929734a096b7e544fc.tar.gz
decky-lsfg-vk-da9c3c8ec04933e921cce0929734a096b7e544fc.zip
Merge pull request #102 from xXJSONDeruloXx/lsfg-vk-9.0-upstream
initial test to build on noui package based on upstream build of lsfg…
-rw-r--r--package.json8
-rw-r--r--py_modules/lsfg_vk/constants.py2
-rw-r--r--py_modules/lsfg_vk/installation.py37
-rw-r--r--src/components/NerdStuffModal.tsx10
4 files changed, 48 insertions, 9 deletions
diff --git a/package.json b/package.json
index 237961c..2da789b 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "decky-lossless-scaling-vk",
- "version": "0.7.5",
+ "version": "0.8.0",
"description": "Use Lossless Scaling on the Steam Deck using the lsfg-vk vulkan layer",
"type": "module",
"scripts": {
@@ -45,9 +45,9 @@
"remote_binary_bundling" : true,
"remote_binary": [
{
- "name": "lsfg-vk_archlinux.zip",
- "url": "https://github.com/xXJSONDeruloXx/lsfg-vk/releases/download/upstream-16403902734/lsfg-vk_archlinux.zip",
- "sha256hash": "220628261bfea8c81661d37fd0069a02214e85dbf32e28dcb08c5f55a6193075"
+ "name": "lsfg-vk_noui.zip",
+ "url": "https://github.com/xXJSONDeruloXx/lsfg-vk/releases/download/noui-jul26/lsfg-vk_noui.zip",
+ "sha256hash": "90320d382b8e10fdc2e3e5fb370877c29e6b6c3c55a19d70a632976102da268f"
}
],
diff --git a/py_modules/lsfg_vk/constants.py b/py_modules/lsfg_vk/constants.py
index 252c7a5..69989c1 100644
--- a/py_modules/lsfg_vk/constants.py
+++ b/py_modules/lsfg_vk/constants.py
@@ -15,7 +15,7 @@ SCRIPT_NAME = "lsfg"
CONFIG_FILENAME = "conf.toml"
LIB_FILENAME = "liblsfg-vk.so"
JSON_FILENAME = "VkLayer_LS_frame_generation.json"
-ZIP_FILENAME = "lsfg-vk_archlinux.zip"
+ZIP_FILENAME = "lsfg-vk_noui.zip"
# File extensions
SO_EXT = ".so"
diff --git a/py_modules/lsfg_vk/installation.py b/py_modules/lsfg_vk/installation.py
index 996a03f..b0e05ad 100644
--- a/py_modules/lsfg_vk/installation.py
+++ b/py_modules/lsfg_vk/installation.py
@@ -6,6 +6,7 @@ import os
import shutil
import zipfile
import tempfile
+import json
from pathlib import Path
from typing import Dict, Any
@@ -102,9 +103,43 @@ class InstallationService(BaseService):
dst_dir = dest_map.get(file_path.suffix)
if dst_dir:
dst_file = dst_dir / file
- shutil.copy2(src_file, dst_file)
+
+ # Special handling for JSON files - need to modify library_path
+ if file_path.suffix == JSON_EXT and file == JSON_FILENAME:
+ self._copy_and_fix_json_file(src_file, dst_file)
+ else:
+ shutil.copy2(src_file, dst_file)
+
self.log.info(f"Copied {file} to {dst_file}")
+ def _copy_and_fix_json_file(self, src_file: Path, dst_file: Path) -> None:
+ """Copy JSON file and fix the library_path to use relative path
+
+ Args:
+ src_file: Source JSON file path
+ dst_file: Destination JSON file path
+ """
+ try:
+ # Read the JSON file
+ with open(src_file, 'r') as f:
+ json_data = json.load(f)
+
+ # Fix the library_path from "liblsfg-vk.so" to "../../../lib/liblsfg-vk.so"
+ if 'layer' in json_data and 'library_path' in json_data['layer']:
+ current_path = json_data['layer']['library_path']
+ if current_path == "liblsfg-vk.so":
+ json_data['layer']['library_path'] = "../../../lib/liblsfg-vk.so"
+ self.log.info(f"Fixed library_path from '{current_path}' to '../../../lib/liblsfg-vk.so'")
+
+ # Write the modified JSON file
+ with open(dst_file, 'w') as f:
+ json.dump(json_data, f, indent=2)
+
+ except (json.JSONDecodeError, KeyError, OSError) as e:
+ self.log.error(f"Error fixing JSON file {src_file}: {e}")
+ # Fallback to simple copy if JSON modification fails
+ shutil.copy2(src_file, dst_file)
+
def _create_config_file(self) -> None:
"""Create the TOML config file in ~/.config/lsfg-vk with default configuration and detected DLL path"""
# Import here to avoid circular imports
diff --git a/src/components/NerdStuffModal.tsx b/src/components/NerdStuffModal.tsx
index 104e772..b5689c9 100644
--- a/src/components/NerdStuffModal.tsx
+++ b/src/components/NerdStuffModal.tsx
@@ -2,7 +2,8 @@ import { useState, useEffect } from "react";
import {
ModalRoot,
Field,
- Focusable
+ Focusable,
+ Button
} from "@decky/ui";
import { getDllStats, DllStatsResult, getConfigFileContent, getLaunchScriptContent, FileContentResult } from "../api/lsfgApi";
@@ -155,8 +156,7 @@ export function NerdStuffModal({ closeModal }: NerdStuffModalProps) {
borderRadius: "4px",
fontSize: "0.8em",
whiteSpace: "pre-wrap",
- overflow: "auto",
- maxHeight: "200px"
+ overflow: "auto"
}}>
{configContent.content || "No content"}
</pre>
@@ -165,6 +165,10 @@ export function NerdStuffModal({ closeModal }: NerdStuffModalProps) {
)}
</Field>
)}
+
+ <Button onClick={closeModal}>
+ Close
+ </Button>
</>
)}
</ModalRoot>