summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxXJSONDeruloXx <danielhimebauch@gmail.com>2025-07-14 20:57:57 -0400
committerxXJSONDeruloXx <danielhimebauch@gmail.com>2025-07-14 20:57:57 -0400
commit9a679fc4b70dad9c4894b7886d62ad41d0596251 (patch)
treeca37660a1f56723bfb467fd75deb9caf433163aa
parent858e7e7beb3748ebbbbc066af0fbde0379b8eef6 (diff)
downloaddecky-lsfg-vk-9a679fc4b70dad9c4894b7886d62ad41d0596251.tar.gz
decky-lsfg-vk-9a679fc4b70dad9c4894b7886d62ad41d0596251.zip
dynamic option 2 var display
-rw-r--r--README.md2
-rw-r--r--src/components/Content.tsx2
-rw-r--r--src/components/UsageInstructions.tsx58
3 files changed, 43 insertions, 19 deletions
diff --git a/README.md b/README.md
index 0f6d4da..d2f755d 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ A Decky plugin that streamlines the installation of **lsfg-vk** ([Lossless Scali
3. **Click "Install lsfg-vk"** to automatically set up the lsfg-vk vulkan layer
4. **Configure settings** using the plugin's UI.
5. **Apply launch commands** to the game you want to use frame generation with:
- - **Option 1 (Recommended)**: `~/lsfg %COMMAND%` - Uses your plugin configuration
+ - **Option 1 (Recommended)**: `~/lsfg %command%` - Uses your plugin configuration
- **Option 2**: Manual environment variables like `ENABLE_LSFG=1 LSFG_MULTIPLIER=2 %COMMAND%`
- See the [LSFG-VK WIKI](https://github.com/PancakeTAS/lsfg-vk/wiki/Configuring-lsfg%E2%80%90vk) for more information on each available environment variable
diff --git a/src/components/Content.tsx b/src/components/Content.tsx
index cecb142..0e17f3c 100644
--- a/src/components/Content.tsx
+++ b/src/components/Content.tsx
@@ -102,7 +102,7 @@ export function Content() {
/>
)}
- <UsageInstructions multiplier={config.multiplier} />
+ <UsageInstructions config={config} />
</PanelSection>
);
}
diff --git a/src/components/UsageInstructions.tsx b/src/components/UsageInstructions.tsx
index 712d4c1..3df3d78 100644
--- a/src/components/UsageInstructions.tsx
+++ b/src/components/UsageInstructions.tsx
@@ -1,10 +1,47 @@
import { PanelSectionRow } from "@decky/ui";
-interface UsageInstructionsProps {
+interface ConfigType {
+ enableLsfg: boolean;
multiplier: number;
+ flowScale: number;
+ hdr: boolean;
+ perfMode: boolean;
+ immediateMode: boolean;
}
-export function UsageInstructions({ multiplier }: UsageInstructionsProps) {
+interface UsageInstructionsProps {
+ config: ConfigType;
+}
+
+export function UsageInstructions({ config }: UsageInstructionsProps) {
+ // Build manual environment variables string based on current config
+ const buildManualEnvVars = (): string => {
+ const envVars: string[] = [];
+
+ if (config.enableLsfg) {
+ envVars.push("ENABLE_LSFG=1");
+ }
+
+ // Always include multiplier and flow_scale if LSFG is enabled, as they have defaults
+ if (config.enableLsfg) {
+ envVars.push(`LSFG_MULTIPLIER=${config.multiplier}`);
+ envVars.push(`LSFG_FLOW_SCALE=${config.flowScale}`);
+ }
+
+ if (config.hdr) {
+ envVars.push("LSFG_HDR=1");
+ }
+
+ if (config.perfMode) {
+ envVars.push("LSFG_PERF_MODE=1");
+ }
+
+ if (config.immediateMode) {
+ envVars.push("MESA_VK_WSI_PRESENT_MODE=immediate");
+ }
+
+ return envVars.length > 0 ? `${envVars.join(" ")} %command%` : "%command%";
+ };
return (
<PanelSectionRow>
<div
@@ -32,7 +69,7 @@ export function UsageInstructions({ multiplier }: UsageInstructionsProps) {
marginBottom: "6px"
}}
>
- ~/lsfg %COMMAND%
+ ~/lsfg %command%
</div>
<div style={{ marginBottom: "4px" }}>
Option 2: Manual environment variables:
@@ -47,20 +84,7 @@ export function UsageInstructions({ multiplier }: UsageInstructionsProps) {
marginBottom: "6px"
}}
>
- ENABLE_LSFG=1 LSFG_MULTIPLIER={multiplier} %COMMAND%
- </div>
- <div style={{ fontSize: "11px", opacity: 0.8 }}>
- The lsfg script uses your current configuration settings.
- <br />
- • ENABLE_LSFG=1 - Enables frame generation
- <br />
- • LSFG_MULTIPLIER=2-4 - FPS multiplier (start with 2)
- <br />
- • LSFG_FLOW_SCALE=0.25-1.0 - Flow scale (for performance)
- <br />
- • LSFG_HDR=1 - HDR mode (only if using HDR)
- <br />
- • MESA_VK_WSI_PRESENT_MODE=immediate - Disable vsync
+ {buildManualEnvVars()}
</div>
</div>
</PanelSectionRow>