Monitor Switcher

v1.0 · macOS 26+ · Apple silicon

GitHub ↗

Menu bar utility

Your keyboard is the KVM switch

One monitor, two machines, and a keyboard that pairs to both. Many Keychrons switch hosts with Fn + 1 and Fn + 2. Send the keyboard to your Mac and the display follows it. Send it back and the display goes too. No reaching behind the monitor.

09:41
This MacUSB-C · input 27
Second machineHDMI 1 · input 17
U4025QW
Keychron K1 Pro
Paired with the second Mac

    Try it: send the keyboard to a Mac and the display follows

    The setup

    Two Macs, one display

    Both Macs stay plugged in: one on USB-C, one on HDMI. The app runs on the USB-C Mac, which is the one watching the keyboard and the one that hands the display over when the keyboard leaves. The keyboard stays paired to both, so a key combo moves it and the display follows.

    How the desk is wired One display with two Macs attached. This Mac connects over USB-C on input 27 and runs MonitorSwitcher; the second Mac connects over HDMI 1 on input 17. A Bluetooth keyboard is paired to both Macs and moves between them with a key combo. The display currently shows this Mac. THIS MAC · USB-C · INPUT 27 U4025QW · DISPLAY 1 USB-C · INPUT 27 HDMI 1 · INPUT 17 This Mac RUNS THE APP Second Mac NO APP NEEDED FN + 1 FN + 2 PAIRED TO BOTH MACS

    Detection

    How it knows

    Two independent sources feed one state machine. The HID watcher catches the instant macOS publishes or tears down the keyboard, whether Bluetooth Classic or BLE. IOBluetooth fills in the names of paired keyboards that are switched off, so you can choose yours before you turn it on.

    IOKit
    HID publish / terminate
    IOBluetooth
    Connect / disconnect
    Merge
    By MAC address
    Debounce
    1.5 s, edges only
    m1ddc
    set input

    Reference

    Specifications

    Detection
    IORegistry HID notifications and IOBluetooth, merged by MAC address
    Latency
    Event-driven. No polling, no timers.
    Keyboards
    Bluetooth Classic and BLE. Any HID device, if you widen the filter.
    Multi-host
    Needed for the hands-free version: a keyboard that stays paired to both machines and moves between them with a key combo, the way most Keychron models do with Fn + 1 / Fn + 2. Switching the keyboard away from the Mac disconnects it, which is the signal this app waits for. A keyboard you simply turn on and off works too.
    Permissions
    None. The keyboard is never opened, so macOS never asks for Input Monitoring.
    Debounce
    1.5 s, so a keyboard that drops and relinks produces one switch, not five
    Retries
    4 attempts, 2 s apart, for a monitor still waking up
    Inputs
    Any DDC code. 15 16 17 18 27 preset; defaults are 27 on connect, 17 on disconnect.
    Display
    Any display m1ddc lists, picked by number
    Login
    Opens at login via SMAppService
    Requires
    macOS 26 or later, Apple silicon, and m1ddc

    Two routes, pick one

    Get it

    Take the prebuilt app or build it yourself. Either way you end up with the same MonitorSwitcher.app in your Applications folder, so you only need one of the two.

    Before either route: input switching is done by m1ddc, so install that first.

    $ brew install m1ddc

    Route A · Prebuilt

    Download the app

    A prebuilt, zipped app. Unzip it, drag it to Applications, open it. Nothing to compile, no toolchain needed.

    Download for macOS MonitorSwitcher.app · v1.0 · macOS 26+ · Apple silicon
    or

    Route B · From source

    Build it yourself

    Read the code before you run it. Two commands: the build script compiles the app, copies it to Applications and launches it.

    $ git clone https://github.com/bearonahill/monitor-switcher.git
    $ cd monitor-switcher && ./build.sh --install
    Source on GitHub ↗

    Whichever route you took, open the menu bar icon, choose Watch Keyboard, and pick yours. Keyboards that are paired but switched off are listed too, so you can set this up before you turn the keyboard on. The icon fills in while the keyboard is connected.