@thomasfuchs I can vouch for https://github.com/haimgel/display-switch in combination with any off the shelf USB switch (for example https://www.microcenter.com/product/665085/ugreen-2-in-4-out-usb-30-sharing-switch-box). The software runs on each machine that you want to switch between, and listens for USB devices appearing/disappearing.
When they do, it tells the monitor to switch inputs via some monitor firmware black magic that I don't fully understand. Works great though!