My use case is a bit different. I have two Windows machines and a dual monitor setup. I use NirSoft ControlMyMonitor which has a CLI and a Elgato Stream Deck.
In a normal KVM approach both monitors are showing only one computer. My use case is a bit odd- I want one computer on monitor A and the other on monitor B. I may also want to flip that. I use a portrait and landscape setup. Then I want to be able to switch mouse/keyboard independently of monitor configuration.
Each computer runs the Stream Deck software and the Stream Deck is connected to the USB switch.