Long story short, after many years of tinkering with mixed PC computer desk setups, it feels like I might have found a solution to my desk setup problems.
I have always had a gaming PC and a laptop. In 2019, I bought a ASUS Zenbook S 13" with Thunderbolt port, and shortly after an eGPU which I put my AMD RX 5700 XT GPU in. Despite the slower (Intel i7-8550u) CPU, it ran most games I wanted to run pretty well. It was a great elegant setup, I could use the same laptop for everything. I would still use that kind of setup today, except I went down the Apple path.
I bought a MacBook Air 13 M1 in 2021, and then my gaming PC became a separate machine. Despite what appears on YouTube, gaming on Macs is still not nearly as good as even gaming on Linux. In my experience, you can use Crossover or Parallels, but in the case of Crossover, game support is patchy, not brilliant. In Parallels, game support is better, but performance is slower. And then there are hardware limitations. For example Starfield requires a CPU with the AVX cpu instruction support, which Apple M-series CPUs do not support, nor emulate. That may change one day for newer chips. And, Macbook internal GPUs are just not as good as a mid range or higher desktop GPU.
I have tinkered with hardware KVM switches, but I find them rather clunky, lots of cables everywhere and requires pressing a separate button on a box that's not always super accessible. Plus some KVM switches do not fully support all monitor modes. Eg 4K 120Hz, my new monitor is 4K 160Hz.
I have also tried out Parsec, which is quite convenient for streaming displays over the network, and is always better over Ethernet cable of course. I guess I wasn't a fan of paying $10 per month for a relatively simple solution. I then tried out the open source, free alternative, Sunshine and Moonlight. I found that subjectively, at the time of testing, that the video quality was better, and the controls more responsive with those two apps. It was a decent solution for switching to my gaming PC, but after using a direct connection to my gaming PC, I did notice a the decrease in video quality. To my eyes, the encoded video over LAN is worse than lossless video over video cable. An acceptable compromise if you must, but in my case it's been good to try other solutions.
My MSI MAG monitor has built in KVM, but sadly does not have a USB 3.0 hub, just USB 2.0. So for example I can't connect a ethernet adapter, or get good results from a USB video adapter for a second display. It is also fiddly reaching behind the monitor to change input. And another frustrating issue with the KVM monitor, if the desktop goes to sleep, I cannot wake it up using the keyboard over KVM! I have to use a keyboard connected directly. So it's just not great when you switch between a laptop over USB-C and a desktop regularly.
Stumbled on the solution for now - DDC/CI and Samsung API
This is another one of those solutions I discovered with the help of your rainforest-destroying, friendly chatbot - Claude (the free version). I appreciate the help, but also weary to lean into it too much for fear of the negative impacts. That's for another blog post.
Software display switching
The suggestion I found was to use a combination of software monitor control - and network KVM (Eg Synergy).
At Home - MacBook and MSI 4K monitor
This solution uses the DDC/CI interface which is exposed over USB-C and DisplayPort connections. On macOS, I can use the terminal command program m1ddc, m1ddc set input xx which will then make my monitor switch to another input. I can combine that with the "Hammerspoon" macOS app to set a keyboard shortcut to switch to the desktop PC's DisplayPort conection. Then, I can set up Synergy on both machines and use the desktop as the host, and move the mouse cursor over to the mac. On the Linux machine, I can use the ddcutil command which uses a command like ddcutil setvcp 60 15. To run without root, you need to run sudo usermod -aG i2c $USER. Then, you can create a keyboard shortcut in KDE/GNOME/etc. When in Linux, press something like Meta+Shift+H and it will just switch over to the MacBook again.
This finally lets me use my MacBook and desktop PC on the same desk, with maximum video quality for gaming, and the full screen macOS as well. Every other setup has had some compromises (video quality, awkwardness, messy cables, limited video modes, etc).
I must note that it's better to use the desktop PC (gaming machine) as the host, as screen lock doesn't work too well if you're remoting into the desktop PC from macOS.
An example of the Hammerspoon config file:
--[[ switch to PC ]] --
hs.hotkey.bind({"cmd", "shift"}, "G", function()
-- switch monitor to PC
hs.execute("/opt/homebrew/bin/m1ddc set input 15")
--[[ For the Samsung monitor, below ]]--
hs.execute("sh <userdir>/inputswitch-mac.sh")
end)
In the office - Samsung Smart Monitor
I thought I could set up a similar system at the office, but my Samsung M7 4K monitor does not expose DDC/CI control. Instead, another solution is to use some ideas taken from this GitHub repository: smartthings-monitor-input-switch
Instead of using DDC/CI, you can amusingly control your monitor input from the cloud, using SmartThings. With a curl command you can remotely switch your monitor's input. At the office I use Windows and I set up a keyboard shortcut with AutoHotKey v2.
AutoHotKey:
#Requires AutoHotkey v2.0
#+h:: {
Run(A_ComSpec " /c `"C:\<mydir>\inputswitch.bat`"",, "Hide")
}
I can then switch back to the desktop PC from the mac (or Linux) using
#!/bin/bash
# switch-to-mac-smartthings.sh
# Set your SmartThings API access token
TOKEN=""
# Set your Samsung Smart Monitor Device ID
DEVICE_ID=""
# Set your desired input source
INPUT_SOURCE=HDMI2
# Define the SmartThings API endpoint
ENDPOINT="https://api.smartthings.com/v1/devices/${DEVICE_ID}/commands"
# Construct the JSON payload
JSON='[{"component":"main","capability":"samsungvd.mediaInputSource","command":"setInputSource","arguments":["'"${INPUT_SOURCE}"'"]}]'
# Send the POST request
curl -X POST \
-H "Authorization: Bearer ${TOKEN}" \
-H "Content-Type: application/json" \
-d "${JSON}" \
"${ENDPOINT}"
I have always felt like my desktop setups have been in flux forever. Will this stick? Maybe!
Page views: 149