I upgraded my monitor for a U3818DW, which has a built in KVM. Changing between the inputs is a little annoying using the buttons on the monitor, so I configured a keyboard shortcut on Linux and MacOS to switch back and forth.
On Linux, I went to Keyboard shortcuts and assigned a custom shortcut to:
ddcutil setvcp 60 0x12This will swap my input to the Mac, to go back I used the Shortcuts app to run m1ddc, which I installed from brew.
In shortcut, I setup a shortcut that does a Run Shell Script with the following:
/opt/homebrew/bin/m1ddc display 2 set input 17(The builtin display is display 1).
This way I can swap between the Mac and my Fedora machine using just the keyboard. The KVM works very well and even allows me to share the webcam between the two machines.