
Raycast extension plus a Swift helper, connected through Raycast's official Swift bridge, for moving the macOS mouse cursor between displays. The commands have no UI: run one command and the cursor jumps immediately.
x is equal.x and y position inside the display..
├── assets
│ └── icon.png
├── src
│ ├── move-cursor-command.ts
│ ├── move-cursor-next-display-center.ts
│ ├── move-cursor-next-display.ts
│ ├── move-cursor-previous-display-center.ts
│ ├── move-cursor-previous-display.ts
│ └── swift-bridge.d.ts
├── swift
│ └── movecursor
│ ├── Package.swift
│ └── Sources
│ └── movecursor.swift
├── CHANGELOG.md
├── package.json
├── tsconfig.json
└── README.md
The Swift helper is source code under swift/movecursor. Raycast builds and invokes it through swift:../swift/movecursor; no checked-in native binary is required.
Install Xcode. Raycast's Swift bridge currently requires Xcode to build Swift packages.
Create a Raycast extension:
npm create raycast-extension@latest
Choose a no-view TypeScript extension, then replace the generated files with this project's files.
Install dependencies:
npm install
Run the extension in Raycast development mode:
npm run dev
In Raycast, run one of:
Move Cursor to Next Display
Move Cursor to Previous Display
Move Cursor to Next Display Center
Move Cursor to Previous Display Center
Raycast's publish command copies the extension directory into a fork before opening a Store PR. Clean local Swift build output first:
npm run clean:publish
npm run publish
The helper uses CoreGraphics and CGWarpMouseCursorPosition. If macOS blocks cursor movement, grant permission in:
System Settings > Privacy & Security > Accessibility
Add Raycast while developing.
npm run dev.xcodebuild failed to load a required plug-in: run xcodebuild -runFirstLaunch; if it still fails, update or reinstall Xcode.ENOTSUP ... swift/movecursor/.build/debug: run npm run clean:publish, then publish again.Only one display detected: macOS currently reports a single active display.macOS rejected cursor movement: grant Accessibility permission to Raycast and try again.The extension uses Raycast's Swift bridge instead of checking in a prebuilt native executable. That keeps the native code reviewable and avoids binary architecture/signing drift during Store review.
Move the mouse cursor to the next display.
Move the mouse cursor to the previous display.
Move the mouse cursor to the center of the next display.
Move the mouse cursor to the center of the previous display.