Skip to content

Automate switching your Mac's display to be mirrored onto a compatible AirPlay display (e.g. Apple TV), from the command line. The app uses Accessibility and AppleScript to automatically trigger the system menu and select a named device from the AirPlay menu (the device name needs to be passed in the first argument to the app).

License

Notifications You must be signed in to change notification settings

openairplay/AirPlayControl

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AirPlayControl

An Xcode project which compiles into a Mac app that can be launched from the command line and used to automate switching between AirPlay devices. The app uses Accessibility and AppleScript to trigger the system menu and select a device named in the first argument passed to the app.

Usage

  • Build the Xcode project to produce AirPlayControl.app
  • Launch the app from the command line, specifying the name of the AirPlay device to connect to as the first argument. e.g.: $ open -W AirPlayControl.app --args "Living Room"
  • On first launch, MacOS will for your permission to allow the app to use Accessibility. You must grant access to allow the app to control the AirPlay menu.
  • To disconnect from the current airplay device: $ open -W AirPlayControl.app --args "Turn AirPlay Off"

Accessibility

  • You can grant or remove Accessibility permissions at any time, using System Preferences > Security & Privacy > Privacy > Accessibility
    • Drag the app into the list of allowed apps to grant permission
    • Remove the app from the list if you no longer wish to use the app.

License

AirPlayControl is available under the MIT license. See the LICENSE file for more info.

About

Automate switching your Mac's display to be mirrored onto a compatible AirPlay display (e.g. Apple TV), from the command line. The app uses Accessibility and AppleScript to automatically trigger the system menu and select a named device from the AirPlay menu (the device name needs to be passed in the first argument to the app).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 86.1%
  • AppleScript 13.9%