diff --git a/launcher/actions.py b/launcher/actions.py index 30b357b..da063bf 100644 --- a/launcher/actions.py +++ b/launcher/actions.py @@ -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")