summaryrefslogtreecommitdiff
path: root/py_modules/lsfg_vk
diff options
context:
space:
mode:
authorJanleyx <242423638+Janleyx@users.noreply.github.com>2026-07-20 17:35:23 -0400
committerJanleyx <242423638+Janleyx@users.noreply.github.com>2026-07-20 17:35:23 -0400
commit1260aa400e6d19e8d1cbc3d887c8ddcff3058be9 (patch)
treeee392423063c12f150ef4e2a496c7900a48bfcc2 /py_modules/lsfg_vk
parentff3213291a56ea8de73335adcceed3962a40114d (diff)
downloaddecky-lsfg-vk-1260aa400e6d19e8d1cbc3d887c8ddcff3058be9.tar.gz
decky-lsfg-vk-1260aa400e6d19e8d1cbc3d887c8ddcff3058be9.zip
wrap Armada launch inside lsfg script
Diffstat (limited to 'py_modules/lsfg_vk')
-rw-r--r--py_modules/lsfg_vk/configuration.py25
-rw-r--r--py_modules/lsfg_vk/plugin.py10
2 files changed, 17 insertions, 18 deletions
diff --git a/py_modules/lsfg_vk/configuration.py b/py_modules/lsfg_vk/configuration.py
index e479f43..f7a171a 100644
--- a/py_modules/lsfg_vk/configuration.py
+++ b/py_modules/lsfg_vk/configuration.py
@@ -8,6 +8,7 @@ from typing import Dict, Any
from .base_service import BaseService
from .config_schema import ConfigurationManager, CONFIG_SCHEMA, ProfileData, DEFAULT_PROFILE_NAME
from .config_schema_generated import ConfigurationData, get_script_generation_logic
+from .constants import ARMADA_DEVICE_ENV, ARMADA_GAME_LAUNCH
from .types import ConfigurationResponse, ProfilesResponse, ProfileResponse
@@ -123,10 +124,8 @@ class ConfigurationService(BaseService):
generate_script_lines = get_script_generation_logic()
lines.extend(generate_script_lines(config))
- lines.extend([
- "export LSFG_PROCESS=decky-lsfg-vk",
- 'exec "$@"'
- ])
+ lines.append("export LSFG_PROCESS=decky-lsfg-vk")
+ lines.extend(self._generate_game_launch_lines())
return "\n".join(lines) + "\n"
@@ -154,12 +153,22 @@ class ConfigurationService(BaseService):
generate_script_lines = get_script_generation_logic()
lines.extend(generate_script_lines(merged_config))
- lines.extend([
- f"export LSFG_PROCESS={current_profile}",
- 'exec "$@"'
- ])
+ lines.append(f"export LSFG_PROCESS={current_profile}")
+ lines.extend(self._generate_game_launch_lines())
return "\n".join(lines) + "\n"
+
+ @staticmethod
+ def _generate_game_launch_lines() -> list[str]:
+ """Generate a portable exec block with Armada's host wrapper."""
+ device_env = ARMADA_DEVICE_ENV.as_posix()
+ game_launch = ARMADA_GAME_LAUNCH.as_posix()
+ return [
+ f'if [ -f "{device_env}" ] && [ -x "{game_launch}" ]; then',
+ f' exec "{game_launch}" "$@"',
+ "fi",
+ 'exec "$@"',
+ ]
def _get_profile_data(self) -> ProfileData:
"""Get current profile data from config file"""
diff --git a/py_modules/lsfg_vk/plugin.py b/py_modules/lsfg_vk/plugin.py
index 74c1677..cb59b4f 100644
--- a/py_modules/lsfg_vk/plugin.py
+++ b/py_modules/lsfg_vk/plugin.py
@@ -18,7 +18,6 @@ from .dll_detection import DllDetectionService
from .configuration import ConfigurationService
from .config_schema import ConfigurationManager
from .flatpak_service import FlatpakService
-from .constants import ARMADA_DEVICE_ENV, ARMADA_GAME_LAUNCH
class Plugin:
@@ -256,15 +255,6 @@ class Plugin:
Returns:
Dict containing the launch option string and instructions
"""
- # Decky runs through FEX on Armada, so the guest OS identity is not a
- # reliable host check. Require both Armada's native marker and wrapper.
- if ARMADA_DEVICE_ENV.is_file() and ARMADA_GAME_LAUNCH.is_file():
- return {
- "launch_option": f"~/lsfg {ARMADA_GAME_LAUNCH} %command%",
- "instructions": "Use this combined command in Steam Properties, preserving Armada's game-launch wrapper",
- "explanation": "LSFG sets its environment first, then Armada applies the game's FEX profile and launches Proton"
- }
-
return {
"launch_option": "~/lsfg %command%",
"instructions": "Add this to your game's launch options in Steam Properties",