Add moonlight launch option

This commit is contained in:
fred.boniface committed 2026-10-08 14:12:51 +01:00
1 parent 9992bc9aa2
commit 1d39853937
1 file changed
+15
+15
View File
@@ -14,6 +14,8 @@ class ActionDispatcher:
self._run_command(config['cmd'].split())
elif service_type == "power":
self._handle_power_action(config)
elif service_type == "moonlight":
seld._launch_moonlight(config)
else:
print(f"Service type: {service_type}, not known")
@@ -97,6 +99,19 @@ class ActionDispatcher:
self._run_command(cmd)
def _launch_moonlight(self, config):
cmd = ["flatpak", "run", "com.moonlight_stream.Moonlight"]
app_name = config.get("app")
if app_name:
# Launch directly into a specific app stream
cmd.extend(["stream", config["target"], app_name])
else:
# Open the GUI directly to the host's app selection page
cmd.append(config["target"])
self._run_command(cmd)
def _handle_power_action(self, action):
if action == "shutdown":
print("Initiating system shutdown")