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.86k stars 112 forks source link

Confusing error on invalid `on_usb_connect` setting #64

Closed dbr closed 11 months ago

dbr commented 3 years ago

Thanks for this tool, works nicely! One minor thing I encountered while setting it up: if on_usb_connect = "Hdmi1" is set to an invalid value (e.g in my case I guessed "Dp1" before noticing it should be "DisplayPort1"), the error is unhelpful in working out what the cause is:

$ cargo run --
[...]
Error: failed to load configuration

Caused by:
    ParseIntError { kind: InvalidDigit }

This should at least mention the configuration option at fault, and ideally maybe give a list of the available options?