haimgel / display-switch

Turn a $30 USB switch into a full-featured multi-monitor KVM switch
https://haim.dev/posts/2020-07-28-dual-monitor-kvm/
MIT License
2.85k stars 112 forks source link

Support monitor selection #32

Closed mmarb closed 3 years ago

mmarb commented 3 years ago

I have a setup with 3 monitors, and i want to be able to only switch 1 monitors input using this tool. It seems to me this could be a vaild use case for others too, and therefor it would be nice if you could for example whitelilst the specfic monitors to switch in the configuration file.

haimgel commented 3 years ago

I just pushed a change that would support this (see README updates in master). Basically, you would do this: omit on_usb_connect and on_usb_disconnect from the global section, and only add these values to a per-monitor section that you do want to switch. Something like this:

usb_device = "1050:0407"

[monitor1]
monitor_id = "dell"
on_usb_connect = "DisplayPort2"
on_usb_disconnect = "Hdmi1"