Pl3ntz/OpenSharkMacOS

GitHub: Pl3ntz/OpenSharkMacOS

Stars: 1 | Forks: 0

# OpenSharkMacOS

OpenShark icon

License: MIT Platform: macOS 14+ Swift 5.9 Latest release

Open-source macOS configurator for the **Attack Shark R1** wireless gaming mouse — a native SwiftUI app (plus a CLI) built from scratch by reverse-engineering the device protocol. No third-party software required at runtime. ## Features - **Native GUI** — a SwiftUI app with a vector drawing of the R1: click a button on the mouse, pick an action. Native materials, animations, hover/selection states, keyboard navigation, VoiceOver labels. - **Button remapping** — all 6 buttons (left, right, middle, DPI, the two side buttons) → mouse functions, page navigation, media keys, or any keyboard shortcut. Written to the mouse's onboard memory. - **Per-device scroll inversion** — flip the mouse wheel direction while keeping the trackpad's "natural" scrolling untouched. Runs as a login agent. - **CLI** — script everything (`r1 set back key:cmd+left`, etc.). Out of scope for now: DPI/RGB configuration and macros. ## Requirements - macOS 14+ - Attack Shark R1 (USB-C cable or 2.4 GHz dongle — VID `0x1D57`, PID `0xFA60`/`0xFA61`) - Xcode command line tools (Swift 5.9+) ## Install ### Download (easiest) 1. Grab the latest **`OpenShark-vX.Y.Z-macos.zip`** from [**Releases**](https://github.com/Pl3ntz/OpenSharkMacOS/releases). 2. Unzip and move **OpenShark.app** to `/Applications`. 3. The app isn't notarized yet, so the first launch is blocked by Gatekeeper — **right-click the app → Open → Open** (only once), or run: xattr -dr com.apple.quarantine /Applications/OpenShark.app 4. On first use, grant **Input Monitoring** (System Settings → Privacy & Security → Input Monitoring → enable OpenShark) and reopen the app. ### Build from source git clone https://github.com/Pl3ntz/OpenSharkMacOS.git cd OpenSharkMacOS swift build -c release bash scripts/make-app.sh release # bundles dist/OpenShark.app (with icon) open dist/OpenShark.app `make-app.sh` wraps the SwiftPM executable into a `.app` (a bare SwiftPM executable won't show a window). For the CLI: `swift build` then `.build/debug/r1 --help`. ## Permissions macOS gates access to HID devices that can act as keyboards/mice. - **Input Monitoring** — required to talk to the mouse (button remapping + connection detection). On first run the app/CLI requests it; grant it under **System Settings → Privacy & Security → Input Monitoring**, then **quit and reopen** the app. - **Accessibility** — required only for scroll inversion (it uses a `CGEventTap`). ## Usage — GUI Click a button on the mouse drawing (or use the arrow keys) to select it, then pick an action on the right. Changes apply to the mouse immediately and are saved to a profile. ## Usage — CLI r1 show show the current profile r1 set