#!/bin/bash
# Tactical Display - macOS launcher (single file, double-click to run).
# Opens the live dashboard in a chromeless app-mode window via Chrome/Edge/Brave,
# falling back to the default browser. No install, no build, nothing to keep next to it.
# First run after downloading: right-click -> Open (Gatekeeper), or in Terminal:
#   chmod +x ~/Downloads/TacticalDisplay.command && open ~/Downloads/TacticalDisplay.command
URL="https://web.tacticaldisplay.app/index.html?app=mac"
PROFILE="$HOME/Library/Application Support/TacticalDisplay/profile"
mkdir -p "$PROFILE"
for B in \
  "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
  "/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" \
  "/Applications/Brave Browser.app/Contents/MacOS/Brave Browser" \
  "/Applications/Chromium.app/Contents/MacOS/Chromium"; do
  if [ -x "$B" ]; then
    exec "$B" --app="$URL" --user-data-dir="$PROFILE" --start-maximized
  fi
done
exec open "$URL"
