Skip to content

Repository files navigation

switchr

switchr seamlessly moves an MX Master 4 to the host selected on an MX Keys Mini for Mac.

Supported hardware

  • Logitech MX Keys Mini for Mac, Bluetooth product ID 0xB36A
  • Logitech MX Master 4, Bluetooth product ID 0xB042
  • macOS 13 or newer
  • Swift 6.2 or a compatible newer Swift toolchain

Both devices must be paired to the same computers on matching Easy-Switch slot numbers. Selecting keyboard slot 2 sends the mouse to its slot 2.

Bluetooth permission is required.

How it works

  1. switchr connects to the keyboard and mouse through Bluetooth.
  2. It listens for Logitech HID++ Easy-Switch notifications from the keyboard.
  3. When a host key is pressed, it reads the selected slot from the notification.
  4. It sends the same host slot to the mouse through Logitech HID++.
  5. Both devices connect to the selected computer.
  6. When the devices return, switchr reconnects and resumes listening automatically.

Setup

Run every command from the project directory.

1. Build

sh build.sh

The executable is created at:

.build/release/switchr

2. Grant Bluetooth permission

sh grant-permission.sh

Enable switchr under Privacy & Security → Bluetooth when System Settings opens.

3. Install and start the daemon

sh install.sh

This installs and starts the LaunchAgent. It starts automatically when you log in.

4. Verify

sh logs.sh

Expected readiness lines include:

Bluetooth state=5 authorization=3
keyboard ready pid=0xB36A
keyboard notifications enabled
mouse ready pid=0xB042

Press an Easy-Switch key. A successful switch logs:

keyboard switching from host 1 to host 2
mouse switch command sent for host 2

Stop following logs with Ctrl+C.

Repeat this setup on every Mac from which the keyboard should initiate a synchronized switch.

Status

launchctl print "gui/$UID/dev.switchr.agent"

The log is stored at ~/Library/Logs/switchr.log.

Update

Source changes require a rebuild:

sh uninstall.sh
sh build.sh
sh grant-permission.sh
sh install.sh

After rebuilding, confirm Bluetooth permission is enabled and the logs show authorization=3.

Uninstall

sh uninstall.sh

This stops and removes the LaunchAgent.

Troubleshooting

  • No switchr entry in Bluetooth settings: run sh build.sh, then sh grant-permission.sh again.
  • authorization is not 3: enable switchr in Privacy & Security → Bluetooth.
  • mouse unavailable: ensure the mouse is connected to this Mac and Logi Options+ can see it.
  • Keyboard is ready but no switch is detected: confirm the keyboard is the supported MX Keys Mini for Mac and disable competing Easy-Switch relay utilities.
  • Mouse moves to the wrong computer: pair keyboard and mouse hosts to matching slot numbers.
  • Project was moved: run sh uninstall.sh, then sh install.sh from the new stable path.

About

Instantly switch both logitech mx keys and mx master using the easy switch key

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages