Switch between Mac laptop and Linux desktop on one monitor using built-in KVM plus DDC commands bound to a single keyboard shortcut.
Key Takeaways
Monitor choice matters: MSI MPG 321URX has built-in KVM so USB peripherals automatically follow the active input source.
DDC (Display Data Channel) lets you send input-switching commands over HDMI/DisplayPort/USB-C without touching the monitor.
macOS uses m1ddc + Hammerspoon hotkey; Linux uses ddcutil + KDE shortcuts manager; both bound to CTRL+SHIFT+=.
USB-C Alt Mode reports as DisplayPort in ddcutil capabilities, so deduce the correct input code by elimination.
No external KVM switch hardware needed; the whole setup is keyboard-driven and cross-platform.
Hacker News Comment Review
Several commenters were unaware DDC could send input-switching commands programmatically, treating it as a genuine hidden capability worth knowing.
Alternative approaches surfaced: xrandr --output off triggers auto-input switching on Linux; Synergy with per-config shell scripts handles headless machines; Dell Display Manager does this natively on compatible Ultrasharp monitors.
Skeptics noted an external KVM switch is the simpler answer, but the article’s value is eliminating that hardware by combining a KVM-capable monitor with DDC scripting.
Notable Comments
@timonoko: xrandr --output DVI-D-0 --off forces auto-input switching, enabling multi-display scripting across two machines via SSH without DDC.
@mdswanson: Dell Display Manager on compatible Dell monitors provides the same DDC input-switching with a GUI, no scripting required.