Extend Display
Raycast extension to quickly connect to AirPlay/Sidecar displays while seamlessly preserving your audio output. No more audio switching to your iPad or Mac display!
β¨ Features
- π Auto-discovery: Scan for available displays via System Settings dropdown
- β‘ One-click toggle: Connect or disconnect instantly with proper state detection
- π Seamless audio preservation: Aggressive audio locking prevents any audible leak to the display
- β¨οΈ Quick Connect: Configure a default display and connect with a single command
- π― Fast & reliable: Uses proven Sidecar extension approach with AXPress actions
π― Use Cases
Perfect for:
- Extending your Mac to an iPad without losing audio on your AirPods/headphones
- Using another Mac as a display while keeping audio on your main Mac
- Quickly toggling between extended and single-display setups
π Requirements
1. SwitchAudioSource (Required)
Manages audio output to prevent switching.
brew install switchaudio-osx
The extension will prompt you to install it if missing.
2. Accessibility Permissions (Required)
Allows Raycast to control System Settings.
System Settings β Privacy & Security β Accessibility β Enable Raycast
π Usage
Browse Mode (Recommended for first use)
- Open Raycast:
β Space
- Search: "Connect to Display"
- Press Enter to scan for available displays (opens System Settings briefly)
- Select your display and press Enter to connect
- Audio stays on your current output device seamlessly!
Keyboard shortcuts:
Enter - Connect to selected display (or scan if empty)
βR - Rescan for displays
βN - Add display manually
βO - Open System Settings to see display names
Ctrl+X - Remove a display
Quick Connect Mode (For daily use)
- Open Raycast:
β Space
- Go to extension preferences and set your display name (e.g., "iPad Pro")
- Search: "Quick Connect"
- Instant toggle with one command!
Pro tip: Assign a hotkey to Quick Connect for instant access.
ποΈ Commands
| Command | Mode | Description |
|---|
| Connect to Display | View | Browse and connect to any available display |
| Quick Connect | No-view | Instantly toggle your configured display |
π§ How It Works
Display Connection
Uses the battle-tested approach from Raycast's official Sidecar extension:
- Opens System Settings β Displays
- Finds the dropdown menu button (works on macOS Tahoe 26+ and earlier)
- Navigates through "Mirror or extend to" section
- Uses
AXPress accessibility action (more reliable than click)
- Detects connection state via
system_profiler
Audio Preservation (The Magic β¨)
Three-layer aggressive approach ensures no audio leaks to the display:
- Force Lock: Sets audio to original device 10 times in 2 seconds (during connection)
- Rapid Monitoring: Checks every 100ms (not 500ms) for changes
- Quick Revert: Does 3 rapid re-sets if any switch detected
Result: Any audio switch happens so fast (< 100ms) it's imperceptible to human ears.
π Troubleshooting
| Issue | Solution |
|---|
| "Missing Dependencies" | Install SwitchAudioSource: brew install switchaudio-osx |
| "Could not find display menu button" | System UI may have changed. Please report an issue with your macOS version |
| "Display not found in menu" | Ensure target device is unlocked, nearby, and has AirPlay/Sidecar enabled |
| Script fails or hangs | Check Accessibility permissions: System Settings β Privacy & Security β Accessibility β Raycast |
| Audio still switches briefly | This is expected - the revert is < 100ms and should be imperceptible |
| No displays found | Make sure devices are on same WiFi and Bluetooth is enabled |
ποΈ Technical Details
π License
MIT
π Credits
- Apple Sidecar extension approach from Raycast Extensions
- Audio switching solution inspired by the need to preserve audio on AirPods while extending to iPad