sure, i used this[0] for the hotpluging part and these[1] are the udev rules :) in order to switch inputs you should take a look at ddcutil...
[0] https://github.com/olavmrk/usb-libvirt-hotplug/blob/master/u...
[1] https://gist.github.com/4ab23675ab69162934ce75b52bd1d290