PSA: Many 4K Dell monitors (like my Dell UltraSharp U3219Q ) have a built-in KVM switch and they support full DDC commands for switching the input as well (over HDMI, DP and USBC). I can control them from Mac and Linux with hot keys that trigger the appropriate ddc commands.
I have a short script that will allow me to change input on a specific display. Very handy. However please note, that while this does work for HDMI, DVI and Displayport only DVI/HDMI seems to have an active connection when another input has been selected.
That means that while I can switch to another input I can not switch back from the same computer but must install something on the other machine to give it back. This is of course exactly what the linked article is doing, but with HDMI/DVI I don't have to have that requirement. And on top of that, operating systems in general seem to believe that, when using displayport, switching to another input is equivalent to disconnecting the display altogether and thus remove it and rearrange windows etc. Insanely frustrating.
Again, no problem with HDMI/DVI. So although Displayport is a much better interface and I've been a strong advocate for it, these issues makes me hate it with passion.
DDC can also be used to change display brightness, which in my opinion is way too cumbersome to do manually (especially if you have more than one display).