{"slug": "i-spent-4-in-ai-tokens-to-avoid-buying-a-10-hdmi-switch-and-it-was-worth-it", "title": "I Spent $4 in AI Tokens to Avoid Buying a $10 HDMI Switch (And It Was Worth It)", "summary": "A developer spent $4 in AI tokens to avoid buying a $10 HDMI switch by using the DDC/CI protocol to control their LG monitor's input source. They discovered that many LG monitors require an alternate DDC addressing scheme for input switching, and used BetterDisplay to send the correct commands, successfully switching between a MacBook Air and a headless Linux laptop without physical hardware.", "body_md": "*A journey into DDC/CI — the remote-control protocol that has been hiding inside your display cable for over twenty years, and how it turned my monitor into a KVM.*\n\nMy setup looks ordinary: a MacBook Air open on the desk (my primary machine), and an LG 32UN880K — a 32\" 4K monitor with two HDMI ports, DisplayPort, and USB-C. The less ordinary part is behind the MacBook: an ASUS gaming laptop running Linux whose internal screen died. It now lives as a headless tower. The external monitor isn't an accessory for it; it's the *only* display it has — BIOS, boot menu, everything.\n\nKeyboard and mouse were already solved: **Input Leap**, a software KVM, lets me type on the ASUS using the Mac's keyboard and mouse. The unsolved problem was the dumbest one: **switching the monitor between the two machines.** The LG's physical OSD button works, but with several switches a day I could feel its lifespan ticking away under my thumb.\n\nSpoiler: the monitor turned out to speak its own private dialect, and figuring that out is most of this story.\n\nI priced hardware. A 4K@60 HDMI switch with an IR remote runs about $10 — Mac on a 3-in-1 USB-C dongle, ASUS on HDMI, click a remote. It would have worked. It also meant a permanent dongle in the Mac's path, a gamble on whether that dongle even does 4K@60, another box, another remote — a drawer already full of exactly this kind of solution.\n\nI was one \"Buy Now\" click away when, mid-discussion with an AI agent I was using to plan the rewiring, it said something that rerouted the whole project:\n\n*\"Your monitor already speaks DDC/CI. You may not need any of this.\"*\n\nHere's what I learned, and what most people genuinely don't know: inside every HDMI, DisplayPort, and USB-C display cable, alongside the wires carrying gigabits of video, there are two extra wires carrying a humble little I²C bus. It exists so your computer can read the monitor's EDID — its name tag of resolutions and timings.\n\nBut VESA didn't stop there. The **DDC/CI standard** (with the MCCS command set) lets the computer send *commands to the monitor* over that same bus. Brightness (`0x10`\n\n), volume (`0x62`\n\n), power (`0xD6`\n\n) — and the crown jewel:\n\n**VCP code 0x60: input source selection.** Send the right value and the monitor changes inputs. No OSD button. No IR remote. No KVM box. The monitor\n\nEvery OS has tools for this: `m1ddc`\n\nand BetterDisplay on macOS, `ddcutil`\n\non Linux, ControlMyMonitor and Monitorian on Windows.\n\nFirst attempt, with the minimalist tool `m1ddc`\n\n:\n\n```\nm1ddc display 2 set input 17\n```\n\nThe screen **blinked** — and stayed on the Mac. `get input`\n\nreturned `0`\n\n, which is nonsense. I tried other values. Blink, blink, nothing. Yet switching manually with the OSD button worked fine, so the ASUS signal was there.\n\nThe command was clearly *reaching* the monitor — something was happening — but the switch itself was being vetoed. If you've ever tried DDC input switching on an LG and concluded \"it just doesn't work,\" you have been exactly here.\n\nThe breakthrough came from installing BetterDisplay and asking it what inputs the monitor *claims* to have:\n\n```\nbetterdisplaycli get -nameLike=LG -inputSourceList\n1  - DisplayPort 1           [DDCController]\n3  - HDMI 1                  [DDCController]\n...\n14 - DisplayPort 1 (LG alt)  [DDCController]\n15 - DP 2 / USB-C (LG alt)   [DDCController]\n16 - USB-C (LG alt)          [DDCController]\n17 - HDMI 1 (LG alt)         [DDCController]\n18 - HDMI 2 (LG alt)         [DDCController]\n```\n\nThere it was. **Many LG monitors require an alternate DDC addressing scheme for input switching.** Standard-addressed commands arrive, hiccup the link (the blink), and get ignored. LG-alt-addressed commands are honored. My monitor wasn't refusing to speak — I was just speaking the wrong dialect.\n\n```\nbetterdisplaycli perform -nameLike=LG -changeInputSource -value=17\n```\n\nThe Mac desktop vanished and the Linux penguin wallpaper filled the screen. I may have said something out loud to no one.\n\nSwitching *to* the ASUS was solved. Switching back was a new puzzle: `16`\n\n(\"USB-C (LG alt)\") did nothing. So we swept the candidates — my terminal on the MacBook's little screen printing `TRYING 16`\n\n, `TRYING 6`\n\n, `TRYING 15`\n\n... while the big monitor still showed Linux, waiting for one command to bring the Mac home.\n\n**\"Came back at 15\"** — *DP 2 / USB-C (LG alt)*. In hindsight it makes sense: USB-C alt mode *is* DisplayPort, and this firmware files its USB-C port under DP.\n\nTwo things worth writing down that day:\n\n`get input`\n\nwith `0`\n\nno matter what. Verify codes by watching the screen, then hardcode them.Emboldened, I scripted a test loop and fired about ten input switches in under a minute. The monitor responded by dropping the USB-C link *entirely*. macOS removed the display from its device list, the screen went to \"no signal,\" DDC went dark, and every subsequent command returned `Failed.`\n\nUnplugging and replugging the cable didn't even revive it — the physical button did.\n\nNew rule, now embedded in my aliases as a `sleep`\n\n: treat input switching like a physical relay, not a function call. One command, a beat of silence, then the next.\n\nJust when I thought I was done, I noticed the flaw in paradise — and it's the one the $10 switch never could have solved, because it isn't a video problem at all.\n\nWith a direct USB-C connection, the link between Mac and monitor *stays alive* even when the monitor displays another input — that's precisely why DDC still works. So macOS thinks the LG is right there. Switch to the ASUS, and all my Mac windows stay parked on a desktop I can't see. The old HDMI switch \"fixed\" this by amputation: cutting the link so macOS panics and dumps every window onto the laptop screen — never to return them.\n\nThe better answer: **don't cut the link, mirror it.** When switching to the ASUS, mirror the MacBook's display onto the LG's desktop. Nothing moves; every window just becomes simultaneously visible on the laptop screen. On the way back, unmirror. I tested both directions with a paranoid eye on window positions: layout intact, layout intact.\n\n```\nbetterdisplaycli set -name=\"Built-in Display\" -mirror=on  -targetNameLike=LG\nbetterdisplaycli set -name=\"Built-in Display\" -mirror=off\n```\n\nThe whole workflow, end to end, is two shell aliases:\n\n``` php\n# 17 = HDMI 1 (LG alt) -> ASUS | 15 = DP 2 / USB-C (LG alt) -> Mac\nalias asus_display='betterdisplaycli perform -nameLike=LG -changeInputSource -value=17; sleep 1; betterdisplaycli set -name=\"Built-in Display\" -mirror=on -targetNameLike=LG'\nalias mac_display='betterdisplaycli set -name=\"Built-in Display\" -mirror=off; sleep 1; betterdisplaycli perform -nameLike=LG -changeInputSource -value=15'\n```\n\nWiring: MacBook → one USB-C cable (4K@60 + 60W charging + the monitor's USB hub). ASUS → HDMI direct, so its BIOS and boot screen always work — non-negotiable with a dead panel. Keyboard/mouse on a cheap USB 2-host switch for dedicated ASUS sessions; Input Leap covers the other 90%.\n\n**Total hardware spend on display switching: $0.** Everything used from BetterDisplay is free-tier; it lives in my login items and I have never once opened its GUI. Total *token* spend: about $4, which bought me a debugging partner that knows DDC dialects — and, fine, a blog post hook.\n\nTwo aliases, typed from either machine, and the screen just knows where it's supposed to be looking.\n\nThe one thing worth carrying forward, if you're about to do this yourself: **your monitor's DDC implementation is a snowflake, and the only way to know its dialect is to test it, not read about it.** Codes differ by vendor and firmware, read-back can lie outright, and some models (NVIDIA's proprietary Linux driver in particular) hide the DDC bus from `ddcutil`\n\nbefore you ever get to the fun part. Budget ten minutes: send a code, watch the screen, write down what actually happened — not what the spec sheet promised.\n\nAnd two hard boundaries worth knowing before you start: DDC needs a running OS, so anything that needs pre-boot access (BIOS, GRUB) stays on dumb HDMI regardless of how clever your setup gets. And the target machine has to be awake — switch to a sleeping laptop and you'll earn a \"no signal\" screen and a walk to the monitor button anyway.\n\nDDC/CI has ridden inside every display cable for more than two decades, and almost nobody knows it exists. We keep buying plastic boxes and IR remotes to solve with hardware a problem our computers could already solve with a protocol that's already plugged in.\n\nRight now, switching desks means typing `asus_display`\n\ninto a terminal that isn't even visible on the screen I'm about to hijack. The cable never moves. The button never gets pressed. Before you buy a KVM switch, give `betterdisplaycli`\n\n, `ddcutil`\n\n, or ControlMyMonitor ten minutes — worst case, you're out ten minutes; best case, your monitor was the KVM all along.\n\n*Setup: MacBook Air (Apple Silicon), ASUS laptop on Linux with a dead internal display, LG 32UN880K, BetterDisplay 4.3.5 (free tier), Input Leap for keyboard/mouse. Your input codes will differ — test empirically. Debugging credit: one persistent human, one AI agent, and $4 of tokens.*", "url": "https://wpnews.pro/news/i-spent-4-in-ai-tokens-to-avoid-buying-a-10-hdmi-switch-and-it-was-worth-it", "canonical_source": "https://dev.to/shiv_garg_ec7172f9eeb7cff/i-spent-4-in-ai-tokens-to-avoid-buying-a-10-hdmi-switch-and-it-was-worth-it-1pem", "published_at": "2026-08-04 19:19:33+00:00", "updated_at": "2026-08-04 19:46:26.494636+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["LG", "MacBook Air", "ASUS", "Input Leap", "BetterDisplay", "m1ddc", "ddcutil", "VESA"], "alternates": {"html": "https://wpnews.pro/news/i-spent-4-in-ai-tokens-to-avoid-buying-a-10-hdmi-switch-and-it-was-worth-it", "markdown": "https://wpnews.pro/news/i-spent-4-in-ai-tokens-to-avoid-buying-a-10-hdmi-switch-and-it-was-worth-it.md", "text": "https://wpnews.pro/news/i-spent-4-in-ai-tokens-to-avoid-buying-a-10-hdmi-switch-and-it-was-worth-it.txt", "jsonld": "https://wpnews.pro/news/i-spent-4-in-ai-tokens-to-avoid-buying-a-10-hdmi-switch-and-it-was-worth-it.jsonld"}}