Skip to content

The tool to switch Magic Trackpad connections between multiple Mac devices

License

Notifications You must be signed in to change notification settings

mizdra/magic-trackpad-switcher

Repository files navigation

magic-trackpad-switcher

The tool to switch Magic Trackpad connections between multiple Mac devices

Features

  • When clamshell mode is enabled...
    1. Unpair Magic Trackpad
    2. Power off the bluetooth module
    3. Sleep system
  • When the system wakes up from sleep...
    1. Power on the bluetooth module
    2. Pair Magic Trackpad

Install

Install magic-trackpad-switcher.

brew install mizdra/tap/magic-trackpad-switcher

Then, add the device ID of your Magic Trackpad to configuration file:

# Check the device ID of your Magic Trackpad
blueutil --paired

# Add the device ID of your Magic Trackpad to configuration file
mkdir -p ~/.config/magic-trackpad-switcher
echo "xx-xx-xx-xx-xx-xx" > ~/.config/magic-trackpad-switcher/TRACKPAD_DEVICE_ID

Finally, start magic-trackpad-switcher service.

brew services start mizdra/tap/magic-trackpad-switcher

Uninstall

brew services stop mizdra/tap/magic-trackpad-switcher
brew uninstall mizdra/tap/magic-trackpad-switcher
rm -rf ~/.config/magic-trackpad-switcher

Update

brew upgrade
brew services restart mizdra/tap/magic-trackpad-switcher

Debug

Run script from source code

git clone git@github.com:mizdra/magic-trackpad-switcher.git
swift run

Logging

tail -F $(brew --prefix)/var/log/magic-trackpad-switcher.log
tail -F $(brew --prefix)/var/log/magic-trackpad-switcher.error.log

About

The tool to switch Magic Trackpad connections between multiple Mac devices

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages