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 different inputs on different monitors #3

Closed akarnani closed 3 years ago

akarnani commented 4 years ago

I have two different monitors, and my computers uses different inputs on each. Would it be possible to somehow map the monitor to the desired input in the config file? Something like:

acer123_monitor_input="DisplayPort1"
dell567_monitor_input="Hdmi1"
haimgel commented 4 years ago

This should be possible, and potentially quite a useful improvement. But: this looks like is a significant amount of work, I won't have cycles for this in the short term, sorry.

akarnani commented 4 years ago

Thanks for the response. I looked into achieving this via monitor name, but noticed (at least on my computers) that the Windows ddc api in rust doesn't return useful names. My next solution is to use an array of inputs since the ordering of monitors returned by both the MacOS and Windows apis appear consistent.

However, MacOS does return useful monitor names which could be used in the configuration. However, that would result in the configuration for MacOS and Windows diverging which is (IMO) undesirable.

Would you accept a pull-request which converts monitor_input into an array of input source values? In the case where there are more displays than values provided I propose that the application simply use the first element as a default.

haimgel commented 4 years ago

Thanks for a PR proposal! Yeah, that would work: an array instead of a single value. I agree that monitor order appears to be consistent: my left and right monitors never swap between them, no matter which one I connect first.

I'd prefer the monitor_input config file parameter to be either a single value or an array: that would most probably require a custom deserializer, but OTOH it would be needed anyway for #6

akarnani commented 3 years ago

Thanks for the fix, much appreciated!