Skip to content

Instantly share code, notes, and snippets.

View ddltn's full-sized avatar

Daniel Dalton ddltn

View GitHub Profile
@ddltn
ddltn / trackpad-toggle
Last active May 15, 2025 06:11
Switch a Magic Trackpad between two Macs
#!/usr/bin/env bash
# Magic Trackpads are notoriously tough to switch between two or more Macs.
# You either need to use a physical cable to move the connections, or unpair it from Mac 1, unpair from Mac 2, then re-pair to the Mac you want to connect to.
# This script automates all that.
# license: MIT
set -euo pipefail
MAC_FILE="$HOME/.magic_trackpad_mac" # cache for Trackpad’s MAC address