Desktop companion — macOS
OpenDeckMac is the SwiftUI companion for open-deck-server. It launches and
manages the server process, shows the pairing QR code, and polls live status.
Requires macOS 14+.
Requirements
- macOS 14 or later
- Swift 5.10 toolchain (Xcode or Command Line Tools)
- The
open-deck-serverbinary — built fromserver/in this repo, onPATH, next to the app, or pointed to withOPENSDECK_SERVER
Build & run
Canonical sources are the SwiftPM package in Sources/OpenDeckMac/:
cd desktop/macos
swift build
swift run OpenDeckMac
There's also a parallel xcodegen Xcode project (OpenDeckMac/ sources,
project.yml — regenerate with xcodegen generate after editing it, never
hand-edit the .xcodeproj):
xcodegen generate
open OpenDeckMac.xcodeproj
Both variants share the same behavior and QR payload.
Using the app
The window has four areas:
- Status — server running state, LAN IP, port, connected phone clients and
captured monitor resolution, refreshed by polling
GET /status. - Pairing — the pairing token plus a QR code rendered via CoreImage. The QR
encodes
opendeck://connect?host=<LAN-IP>&port=<port>&token=<token>(LAN IP viagetifaddrs,en0preferred). - Settings — port, fps, quality, max stream width, and an optional custom
token. Persisted in
UserDefaults. - Log — the server's stdout/stderr banner and recent output.
First run
- Build the server once (
cd server && cargo build --release) or setOPENSDECK_SERVER=/path/to/open-deck-server. - Launch the app.
ServerLocatorsearches$OPENSDECK_SERVER→ the app bundle directory →PATH→ walks up 6 directories looking forserver/target/{release,debug}/open-deck-server. - Press Start (or the equivalent control).
ServerManagerspawns the binary with--port/--fps/--quality/--max-width/--token, scrapes thePairing token/Monitor/WebSocket URLbanner lines, and starts polling/status. - Scan the QR with the phone app, or tap an NFC tag programmed with the same URI. The connect form fills in — tap Connect on the phone.
Day-to-day
- Stop terminates the child process cleanly; quitting the app also kills the server it spawned.
- Change stream settings (fps/quality/max-width) and restart the server to apply them — they become CLI flags on the next launch.
- Set a custom token in Settings if you want a stable pairing token across restarts; otherwise each launch generates a random one.
Troubleshooting
- "Server binary not found" — check
OPENSDECK_SERVER, or buildopen-deck-serverintoserver/target/release/inside the repo. - Phone can't connect — both devices must share a subnet; the QR embeds the
Mac's LAN IP (
en0preferred), which can be wrong behind VPNs or with multiple interfaces — type the address manually then. - Status shows no clients after pairing — confirm the phone tapped
Connect;
/statusonly counts established WebSocket sessions.