summaryrefslogtreecommitdiff
path: root/py_modules/lsfg_vk/installation.py
diff options
context:
space:
mode:
Diffstat (limited to 'py_modules/lsfg_vk/installation.py')
-rw-r--r--py_modules/lsfg_vk/installation.py23
1 files changed, 20 insertions, 3 deletions
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: