summaryrefslogtreecommitdiff
path: root/py_modules
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2025-07-18 12:12:55 -0400
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2025-07-18 12:12:55 -0400
commitf3846f88402b6216675c9c48c04ab5a30cce3062 (patch)
tree32ac1ec1d1229444bb97c531d12a7d5c749d1afe /py_modules
parent48ee73dae1bdecec47ccbaf5456be8c5937cb0fd (diff)
downloaddecky-lsfg-vk-f3846f88402b6216675c9c48c04ab5a30cce3062.tar.gz
decky-lsfg-vk-f3846f88402b6216675c9c48c04ab5a30cce3062.zip
restore clipboard wiki button
Diffstat (limited to 'py_modules')
-rw-r--r--py_modules/lsfg_vk/base_service.py1
-rw-r--r--py_modules/lsfg_vk/installation.py23
-rw-r--r--py_modules/lsfg_vk/plugin.py4
3 files changed, 23 insertions, 5 deletions
diff --git a/py_modules/lsfg_vk/base_service.py b/py_modules/lsfg_vk/base_service.py
index a796480..b595b07 100644
--- a/py_modules/lsfg_vk/base_service.py
+++ b/py_modules/lsfg_vk/base_service.py
@@ -30,6 +30,7 @@ class BaseService:
self.local_lib_dir = self.user_home / LOCAL_LIB
self.local_share_dir = self.user_home / VULKAN_LAYER_DIR
self.lsfg_script_path = self.user_home / SCRIPT_NAME
+ self.lsfg_launch_script_path = self.user_home / SCRIPT_NAME # ~/lsfg launch script
self.config_dir = self.user_home / CONFIG_DIR
self.config_file_path = self.config_dir / CONFIG_FILENAME
diff --git a/py_modules/lsfg_vk/installation.py b/py_modules/lsfg_vk/installation.py
index fc9ac97..d193219 100644
--- a/py_modules/lsfg_vk/installation.py
+++ b/py_modules/lsfg_vk/installation.py
@@ -54,6 +54,9 @@ class InstallationService(BaseService):
# Create the config file
self._create_config_file()
+ # Create the lsfg launch script
+ self._create_lsfg_launch_script()
+
self.log.info("lsfg-vk installed successfully")
return {"success": True, "message": "lsfg-vk installed successfully", "error": None}
@@ -122,6 +125,19 @@ class InstallationService(BaseService):
if config["dll"]:
self.log.info(f"Configured DLL path: {config['dll']}")
+ def _create_lsfg_launch_script(self) -> None:
+ """Create the ~/lsfg launch script for easier game setup"""
+ script_content = """#!/bin/bash
+# lsfg-vk launch script generated by decky-lossless-scaling-vk plugin
+# This script sets up the environment for lsfg-vk to work with the plugin configuration
+export LSFG_PROCESS=decky-lsfg-vk
+exec "$@"
+"""
+
+ # Write the script file
+ self._write_file(self.lsfg_launch_script_path, script_content, 0o755)
+ self.log.info(f"Created lsfg launch script at {self.lsfg_launch_script_path}")
+
def check_installation(self) -> InstallationCheckResponse:
"""Check if lsfg-vk is already installed
@@ -168,13 +184,13 @@ class InstallationService(BaseService):
"""
try:
removed_files = []
- files_to_remove = [self.lib_file, self.json_file, self.config_file_path]
+ files_to_remove = [self.lib_file, self.json_file, self.config_file_path, self.lsfg_launch_script_path]
for file_path in files_to_remove:
if self._remove_if_exists(file_path):
removed_files.append(str(file_path))
- # Also try to remove the old script file if it exists
+ # Also try to remove the old script file if it exists (for backward compatibility)
if self._remove_if_exists(self.lsfg_script_path):
removed_files.append(str(self.lsfg_script_path))
@@ -219,10 +235,11 @@ class InstallationService(BaseService):
self.log.info(f" Library file: {self.lib_file}")
self.log.info(f" JSON file: {self.json_file}")
self.log.info(f" Config file: {self.config_file_path}")
+ self.log.info(f" Launch script: {self.lsfg_launch_script_path}")
self.log.info(f" Old script file: {self.lsfg_script_path}")
removed_files = []
- files_to_remove = [self.lib_file, self.json_file, self.config_file_path, self.lsfg_script_path]
+ files_to_remove = [self.lib_file, self.json_file, self.config_file_path, self.lsfg_launch_script_path, self.lsfg_script_path]
for file_path in files_to_remove:
try:
diff --git a/py_modules/lsfg_vk/plugin.py b/py_modules/lsfg_vk/plugin.py
index 9caf2ea..101542c 100644
--- a/py_modules/lsfg_vk/plugin.py
+++ b/py_modules/lsfg_vk/plugin.py
@@ -360,9 +360,9 @@ class Plugin:
Dict containing the launch option string and instructions
"""
return {
- "launch_option": "LSFG_PROCESS=decky-lsfg-vk %command%",
+ "launch_option": "~/lsfg %command%",
"instructions": "Add this to your game's launch options in Steam Properties",
- "explanation": "This tells lsfg-vk to use the plugin-managed configuration for this game"
+ "explanation": "The lsfg script is created during installation and sets up the environment for the plugin"
}
# Lifecycle methods