From 9a679fc4b70dad9c4894b7886d62ad41d0596251 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Mon, 14 Jul 2025 20:57:57 -0400 Subject: dynamic option 2 var display --- src/components/Content.tsx | 2 +- src/components/UsageInstructions.tsx | 58 +++++++++++++++++++++++++----------- 2 files changed, 42 insertions(+), 18 deletions(-) (limited to 'src/components') 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() { /> )} - + ); } 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 (
- ~/lsfg %COMMAND% + ~/lsfg %command%
Option 2: Manual environment variables: @@ -47,20 +84,7 @@ export function UsageInstructions({ multiplier }: UsageInstructionsProps) { marginBottom: "6px" }} > - ENABLE_LSFG=1 LSFG_MULTIPLIER={multiplier} %COMMAND% -
-
- The lsfg script uses your current configuration settings. -
- • ENABLE_LSFG=1 - Enables frame generation -
- • LSFG_MULTIPLIER=2-4 - FPS multiplier (start with 2) -
- • LSFG_FLOW_SCALE=0.25-1.0 - Flow scale (for performance) -
- • LSFG_HDR=1 - HDR mode (only if using HDR) -
- • MESA_VK_WSI_PRESENT_MODE=immediate - Disable vsync + {buildManualEnvVars()}
-- cgit v1.2.3