Mirror of https://github.com/hsiangenlinlin/air-accept.git

hsiang 7f1e4beb91 Add poll interval menu and log rotation 6 luni în urmă
Resources 173cdf9b3b Initial AirAccept implementation 6 luni în urmă
Sources 7f1e4beb91 Add poll interval menu and log rotation 6 luni în urmă
Tests 7f1e4beb91 Add poll interval menu and log rotation 6 luni în urmă
.gitignore 173cdf9b3b Initial AirAccept implementation 6 luni în urmă
Makefile 173cdf9b3b Initial AirAccept implementation 6 luni în urmă
Package.swift 173cdf9b3b Initial AirAccept implementation 6 luni în urmă
README.md 7f1e4beb91 Add poll interval menu and log rotation 6 luni în urmă

README.md

AirAccept

AirAccept is a small macOS menu bar app that watches for incoming AirPlay Receiver prompts and automatically presses Accept only when the prompt clearly matches an AirPlay request.

It is intended for a Mac that already has the built-in AirPlay Receiver enabled in System Settings.

Requirements

  • macOS Sequoia 15 or Tahoe 26
  • Xcode command line tools or Xcode
  • Accessibility permission for AirAccept

AirAccept does not require Screen Recording and does not use AppleScript/System Events automation.

Build

make test
make app

The app bundle is created at:

build/AirAccept.app

To build and launch in one step:

make run

If open appears to do nothing, run the app in the foreground to see launch errors:

make debug-run

When it is running correctly from debug-run, the command stays active until you quit AirAccept or press Ctrl-C.

You can move that app bundle to /Applications after building. Keeping the app in a stable path is recommended because macOS Accessibility permissions are tied to the app identity and path.

First Run

  1. Launch build/AirAccept.app.
  2. Use the menu bar item AirAccept -> Request Accessibility Permission.
  3. In System Settings, allow AirAccept under Privacy & Security -> Accessibility.
  4. Quit and reopen AirAccept if macOS does not apply the permission immediately.

To confirm it launched, check the log:

tail -n 20 "$HOME/Library/Logs/AirAccept/airaccept.log"

You should see a line like:

[info] ... AirAccept launched pid=12345

Configuration

AirAccept creates this file on first run:

~/Library/Application Support/AirAccept/config.json

Default config:

{
  "poll_interval_ms": 2500
}

poll_interval_ms controls how often AirAccept checks Notification Center for a matching AirPlay request. You can set it from the menu bar under:

AirAccept -> Poll Interval -> 2/3/4/5 seconds

Logs

AirAccept writes newline-delimited JSON events to:

~/Library/Logs/AirAccept/airaccept.log

Each event includes timestamp, host process, prompt summary, parsed device name, action, and reason. It also writes to Apple unified logging with subsystem com.airaccept.AirAccept. The log file rotates at about 1 MB and keeps one previous file at airaccept.log.1.

Launch at Login

Use the menu bar item:

AirAccept -> Launch at Login

This uses SMAppService.mainApp, the macOS 13+ login item API.

Safety Notes

AirAccept does not click arbitrary system dialogs. A prompt must contain AirPlay-specific request text, such as a device wanting to AirPlay to this Mac, and an accept-like Accessibility action before AirAccept clicks through the Accessibility path.