From d9b8e46335bc317344e420687b80ba76cacc1b54 Mon Sep 17 00:00:00 2001 From: Samuel Zielke Date: Wed, 21 Oct 2026 16:09:49 +0200 Subject: [PATCH] feat: --login-item launch argument for headless nodes Co-Authored-By: Claude Opus 5.5 --- App/Sources/Coordinator.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/App/Sources/Coordinator.swift b/App/Sources/Coordinator.swift index f6e56f2..6ce64de 100644 --- a/App/Sources/Coordinator.swift +++ b/App/Sources/Coordinator.swift @@ -40,12 +40,20 @@ final class Coordinator { outputs.applyLaunchRoutes() audio.applyLaunchRoutes() + applyLoginItemArgument() statusTimer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { [weak self] _ in MainActor.assumeIsolated { self?.sendStatus() } } } + /// `--login-item on|off`: set up a headless node over SSH, where the settings window is hidden behind outputs. + private func applyLoginItemArgument(_ arguments: [String] = ProcessInfo.processInfo.arguments) { + guard let index = arguments.firstIndex(of: "--login-item"), index + 1 < arguments.count else { return } + settings.launchAtLogin = arguments[index + 1] == "on" + Log.ndi.info("Launch at login: \(self.settings.launchAtLogin ? "on" : "off", privacy: .public)") + } + /// (Re)starts the Bonjour side that fits the role; call after role or interface changes. func startRemote() async { nodeServer?.stop()