63

I just got a new work laptop. I would like to seamlessly switch my bluetooth devices (headphones, magic keyboard, touchpad) between work / personal Macs without complex repairing.

Has anyone solved this problem?

Ideally, I would love it if my bluetooth devices just paired with the computer docked into my dongle that connects to my monitor / power. Like if there was some kind of USB bluetooth controller that exposed my bluetooth devices as USB devices to whatever was connected to it, that would be awesome. But I haven’t found anything like that. I’m curious if people have different solutions?

It would also be ideal if this could be used for other bluetooth devices, ie seamlessly switch headphones...

6
  • 1
    I was in a similar predicament and found no easy solution. I purchased a Matias wireless keyboard, and it can pair to 4 BT devices. Well worth the US$100. Available at Amazon . Satechi makes a wireless, back-lit BT keyboard which can pair three to 3 BT devices. Disclaimer: no ties, financial or otherwise, to Matias, Satechi or Amazon.
    – IconDaemon
    Oct 8, 2020 at 12:17
  • OK, there are workarounds for keyboard (for instance MX Keys), and for headphone. But what about the Apple Magic Keyboard? Have someone find an alternative with multi device use?
    – HubTech
    Feb 15, 2021 at 6:34
  • 2
    Here is the script I use to switch my Magic Mouse and Magic Keyboard from one macbook to another (with password-less ssh access between the two) without touching the macbooks themselves: gist.github.com/blz777/57d897e7e10759abcff75a12a20799f1 The script still requires a power cycle of the devices (turn both switches off, wait a second, turn both switches back on). (Since both machines are connected to the same monitor, I also have to switch the monitor input to start working on the destination machine.) Mar 13, 2021 at 7:59
  • 1
    @AntonPetrov this should be an answer not a comment!
    – noelicus
    Dec 16, 2021 at 11:27
  • @IconDaemon does the Matias keyboard feel the same (keystroke action) physically as a Mac keyboard?
    – noelicus
    Dec 16, 2021 at 11:28

8 Answers 8

25

The Apple Magic Keyboard does not have similar functionality.

If you want to quickly switch between devices, the best way to do so is to (at least temporarily) connect the keyboard to the Mac you want to use it with via a lightning cable.

Ideally, if you are swapping between them frequently, I would just leave a lightning cable connected to both, and plug it in to the computer you want to use.

Obviously not as slick as something that has a button to press to switch between devices, but it's the best way to switch between devices without buying new hardware.

Toothfairy

There is also a Mac app called Toothfairy which will let you connect/disconnect Bluetooth devices from your menu bar. $5 from the Mac App Store or part of Setapp.

Toothfairy is usually thought of as a tool to help with AirPods, but it works with all sorts of Bluetooth devices, including Magic Keyboard and Trackpad. A nice bonus is that it can show you the battery level of each device in the menu bar as well.

7
  • 1
    I endorse both solutions. USB to lightning cables pair the magic keyboard instantly on macOS in my experience and Logitech devices with three ID and a button are magical as well.
    – bmike
    Oct 8, 2020 at 20:10
  • Will this work if connected to a windows machine (both bootcamped and standard pc)? and/or can you use it as a usb wired keyboard in this way?
    – noelicus
    Dec 16, 2021 at 11:32
  • I have no idea if it will work with Windows, but I assume it will work as a USB keyboard if wired, but honestly I wouldn't be too surprised if it did not.
    – TJ Luoma
    Dec 16, 2021 at 22:36
  • 1
    I've been doing the cable thing for almost two years now and I'm dead bored with it and yes it does wear cables and the connectors down. It is not a good solution for a wireless device.
    – Jonny
    Apr 26, 2022 at 14:19
  • 2
    The Toothfairy site (at the bottom) says this, quote: "Switching Bluetooth devices between multiple Macs requires that the Bluetooth device can be paired with more than one computer/phone at a time; this is not supported by the current-generation Apple Magic Keyboard/Mouse/Trackpad." Can somebody confirm that this solution actually works?
    – Aivean
    Jun 11, 2022 at 2:51
21

Well, after much playing around I was able to find something that is pretty close. This works by installing blueutil and creating an identical automator script on both devices:

  1. Install blue util (can be done via 'bower install blueutil')
  2. Run blueutil --paired and identify device address, this is the device id used below, just substitute '-' with ':' (e.g 40:e6:4b:8d:52:12)
  3. In automator Create new automation of type 'Application'
  4. Add step to 'Run Shell Script'
  5. Enter script (notice my shell is zsh, so if yours is different either install it or update command to fit your shell, such as 'if' statement of parenthesis):
    res=$(<blueutil_folder>/blueutil --is-connected 40:e6:4b:8d:52:12)
    if [[ "$res" = '1' ]]
    then
    <blueutil_folder>/blueutil --unpair 40:e6:4b:8d:52:12
    else
    <blueutil_folder>/blueutil --unpair 40:e6:4b:8d:52:12
    sleep 1
    <blueutil_folder>/blueutil --pair 40:e6:4b:8d:52:12
    sleep 1
    <blueutil_folder>/blueutil --connect 40:e6:4b:8d:52:12
    fi
    
  6. Save the script to desktop.
  7. Copy script to second device, make sure to update the blueutil_folder correctly

now, whenever you want to switch between devices run the script first on the device currently connected to keyboard and then run on the other device and viola! keyboard now connected to other device.

P.S the script sometimes hangs when trying to connect, in such case I turn off and back on the keyboard and run again.

Explanation: first it is checked if we are connected; if we are we disconnect and if not reconnect. When disconnecting from currently connected device unpairing is done to avoid reconnect back and connection issues with other device. When reconnecting pairing and connecting is run (unpair in beginning just in case) Hope this helps, post a comment if it works or experienced other issues.

Good luck!

6
  • 1
    blueutil was not available through bower but was available through brew. Jan 5, 2022 at 5:48
  • The --pair goes into an interactive pairing mode (asks for pin), which doesn't allow me to automate the pairing. E.g. /usr/local/bin/blueutil --pair xxx outputs Type pin code (up to 16 characters) for "xxx" (xxx) and press Enter: .
    – bouke
    Aug 31, 2022 at 8:39
  • 1
    I was able to use the dash separated Bluetooth ID, didn't even need to edit to colon separated.
    – 22degrees
    Oct 28, 2022 at 21:45
  • 1
    @Ophir Brilliant answer. Thanks for shedding light on Automation and ability to write shell scripts on Bluetooth devices!
    – Taku
    Jan 23, 2023 at 12:58
  • 1
    I’ve found this solution to be rather flakey but it’s better than anything else I can come up with, so thank you very much! Aug 4, 2023 at 12:39
8

I would like to seamlessly switch my Bluetooth devices (headphones, magic keyboard, touch pad) between work / personal Macs without complex repairing.

Has anyone solved this problem?

Yes.

You purchase Bluetooth devices (keyboard, mouse, headset, etc.) that have multiple device support.

  • The Magic Keyboard, Mouse, and Trackpad are designed to be paired with a single computer (they make no reference to multiple device pairings). However, products like the Logitech MX series as well as the K380 (typing on it right now) can pair with up to 3 devices and switch with the press of a button.

  • Sennheiser headphones (my personal choice) can pair with up to 8 devices total and with 2 simultaneously. There are many other brands (Bose, Apple AirPods, Sony, etc.) that have this functionality.

There’s no software that is going to your initiate your Bluetooth devices to switch from one device to another - you can only imagine the security implications!

Bottom line, to easily switch between devices without complex the re-pairing as you describe, you need devices that support multiple pairings. If the device doesn’t support it, you’ll need to pair and unpair it each time.

6

I have a lightning cable connected to the hub that drives my external monitor. And connect my work or home laptops to my monitor. Then I can plug that lightning cable in to the magic keyboard and/or trackpad when I switch or when I need to charge the keyboard or trackpad. I don't switch all that often, so it is good enough.

1
  • 1
    Not the most elegant solution but definitelly most hassle-free. Mar 25, 2022 at 9:25
5

If you are using macOS Monterey 12.4 or later you can use Apple Universal Control to switch apple magic keyboard and mouse seamlessly between devices (in your case personal/work macs) without needing and extra hardware of scripts.

On your Mac Choose Apple menu  > System Preferences, then click Displays.

Click the Universal Control button at the bottom of the preferences window.

Select “Allow your pointer and keyboard to move between any nearby Mac or iPad.”

For detailed instructions just visit the apple site, link provided below. https://support.apple.com/en-in/HT212757

4
  • This works for me when I have both computers awake.. but can't seem to figure out how to keep the devices working after putting one of them (in this case the primary one devices are currently connected to) to sleep. Sep 18, 2022 at 17:08
  • Won't work when device is in sleep mode. You can change sleep time using  > System Preferences > Battery > Power Adapter. Please upvote the solution if it was helpful. Thanks.
    – Aukta
    Sep 20, 2022 at 5:23
  • Unfortunately, in my case I use my computers with the lid closed (hooked up to an external monitor).. so I literally switch between computers by plugging out the USBc cable from one into the other (manual KVM style). So this wont work for me since I actually want my other computer to go to sleep. But it may be helpful to others so thanks for posting :) Sep 20, 2022 at 15:36
  • Universal Control is a great solution with no third party requirements, but only works if both macs are logged in with the same AppleID. If you have a work laptop, it likely won't be linked to your personal laptop's AppleID,
    – turkinator
    Dec 22, 2023 at 14:42
4

I've discovered AirBuddy (a lightweight Mac app) that solves this problem seamlessly - it's not free (£15) but works really well and the documentation is great. I use it across two Macs with a different iCloud account on each (meaning I can't use Universal Control) with a Magic Keyboard and Magic Mouse and can't recommend it any higher. It does exactly what it says on the tin, every time and for a reasonable price (all pretty rare imo!)

2

Software KVM solution such as Synergy, Across, others... But you would need permission from Work to install the software on the Work MacBook Pro.

That would work for the KB/Mouse/Trackpad but for the bluetooth headphones they would need to support multiple devices as Allen said.

Your employer may not like the idea of a software KVM. Your mileage may vary, depends on the employers IT / IT Security departments.

2

i just plug the keyboard/mouse with the cable for brief seconds. not very smooth but effective.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .