X11-style primary selection for macOS. Select text anywhere, middle-click to paste. Independent of the system clipboard.
XGhostClip replicates X11's primary selection mechanism on macOS using Core Graphics event monitoring and Accessibility APIs. Text selection automatically populates a separate pasteboard, accessible via middle-click anywhere in the system.
Binary: Download from Releases, move to Applications, launch.
Source:
git clone git@github.com:afasulo/XGhostClip.git
cd XGhostClip && open PrimaryPaste.xcodeprojRequires macOS 15.6+. Accessibility permissions granted automatically on first run.
Works with native macOS applications that implement standard Accessibility APIs: TextEdit, Xcode, Terminal, most editors and IDEs.
Limitation: Cross-platform applications (Chrome, Electron apps) use custom UI frameworks that bypass kAXSelectedTextAttribute, breaking text selection detection.
- Event Tap:
CGEvent.tapCreatemonitors mouse clicks globally - Text Access:
AXUIElementAPIs read/write selected text directly - Storage: Private
NSPasteboardmaintains selection state - Architecture: Menu bar daemon with minimal resource footprint
MIT License. See LICENSE.
Built by Adam Fasulo for developers missing X11 primary selection on macOS.
