summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
-rw-r--r--src/components/ClipboardButton.tsx28
-rw-r--r--src/components/ConfigurationSection.tsx2
-rw-r--r--src/components/UsageInstructions.tsx4
6 files changed, 31 insertions, 31 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
diff --git a/src/components/ClipboardButton.tsx b/src/components/ClipboardButton.tsx
index cf11e6e..3760e81 100644
--- a/src/components/ClipboardButton.tsx
+++ b/src/components/ClipboardButton.tsx
@@ -1,26 +1,9 @@
-import { useState } from "react";
import { PanelSectionRow, ButtonItem } from "@decky/ui";
-import { FaClipboard, FaCheck } from "react-icons/fa";
-import { getLaunchOption } from "../api/lsfgApi";
+import { FaExternalLinkAlt } from "react-icons/fa";
export function ClipboardButton() {
- const [copied, setCopied] = useState(false);
-
- const handleClipboardClick = async () => {
- try {
- // Get the launch option from the backend
- const response = await getLaunchOption();
- const launchOption = response.launch_option;
-
- // Copy to clipboard
- await navigator.clipboard.writeText(launchOption);
- setCopied(true);
-
- // Reset the copied state after 2 seconds
- setTimeout(() => setCopied(false), 2000);
- } catch (error) {
- console.error("Failed to copy launch option:", error);
- }
+ const handleClipboardClick = () => {
+ window.open("https://github.com/xXJSONDeruloXx/decky-lossless-scaling-vk/wiki/Clipboard", "_blank");
};
return (
@@ -28,11 +11,10 @@ export function ClipboardButton() {
<ButtonItem
layout="below"
onClick={handleClipboardClick}
- description="Copy the launch option needed for Steam games"
>
<div style={{ display: "flex", alignItems: "center", gap: "8px" }}>
- {copied ? <FaCheck style={{ color: "green" }} /> : <FaClipboard />}
- <div>{copied ? "Copied!" : "Copy Launch Option"}</div>
+ <FaExternalLinkAlt />
+ <div>Launch Option Clipboard</div>
</div>
</ButtonItem>
</PanelSectionRow>
diff --git a/src/components/ConfigurationSection.tsx b/src/components/ConfigurationSection.tsx
index f44dd4f..bfbeb98 100644
--- a/src/components/ConfigurationSection.tsx
+++ b/src/components/ConfigurationSection.tsx
@@ -48,7 +48,7 @@ export function ConfigurationSection({
<PanelSectionRow>
<SliderField
label="FPS Multiplier"
- description="Traditional FPS multiplier value (1 = no interpolation)"
+ description="Traditional FPS multiplier value (OFF = no interpolation)"
value={config.multiplier}
min={1}
max={4}
diff --git a/src/components/UsageInstructions.tsx b/src/components/UsageInstructions.tsx
index 32aa0ff..fb754b2 100644
--- a/src/components/UsageInstructions.tsx
+++ b/src/components/UsageInstructions.tsx
@@ -55,7 +55,7 @@ export function UsageInstructions({ config }: UsageInstructionsProps) {
>
Required Launch Option:
<br />
- <strong>LSFG_PROCESS=decky-lsfg-vk %command%</strong>
+ <strong>~/lsfg %command%</strong>
</div>
</PanelSectionRow>
@@ -89,7 +89,7 @@ export function UsageInstructions({ config }: UsageInstructionsProps) {
marginTop: "8px"
}}
>
- Add the launch option to each game's Properties → Launch Options in Steam. The configuration is stored in ~/.config/lsfg-vk/conf.toml and hot-reloads while games are running.
+ Add the launch option to each game's Properties → Launch Options in Steam. The lsfg script is automatically created during installation and connects your games to the plugin's configuration. The configuration is stored in ~/.config/lsfg-vk/conf.toml and hot-reloads while games are running.
</div>
</PanelSectionRow>
</>