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

Linux support? #4

Closed twilco closed 3 years ago

twilco commented 4 years ago

This is an awesome project! Do you have any plans for Linux support?

aadrian commented 4 years ago

+1

Maybe for some of the popular distros first?

universal commented 4 years ago

the following might be helpful for the switching part under linux/ubuntu https://askubuntu.com/questions/860761/ubuntu-command-line-to-change-input-source-on-a-display-monitor

haimgel commented 4 years ago

Linux support should totally be possible, without too much hassle. I'll look into this.

useretail commented 4 years ago

without too much hassle

not really, if you're using c

trauner commented 4 years ago

Here’s a quick KVM via USB switch proof of concept in bash that uses lsusb and xrandr for detection and monitor switching for a single monitor. Seems to work alright when testing on Fedora 32 boxes. https://gist.github.com/trauner/5ab3d5bb58dcb068e5332720fe7ef739

haimgel commented 4 years ago

I'm currently trying to unify the codebase into just one language, not two (only Rust for all three platforms), once this is done I'll look into adding a proper Linux support.

haimgel commented 3 years ago

Hey, I've got some preliminary Linux support working: Please see the linked PR #22 for details. I'd appreciate if someone with a real Linux desktop could give it a try.

universal commented 3 years ago

as commented on the pull-request, seems to be working fine for me under ubuntu 20.04 :-) thanks for the work

0xpr03 commented 3 years ago

Yep works also also on KUbuntu 18.04. Thanks again for how much additional features this got!

For documentation: it'll output

[ERROR] Failed to set display '22787' to Hdmi1(0x11) (I2c(Os { code: 121, kind: Other, message: "Remote I/O error"

on my system, because it seems to try also changing the laptop display input.. But this doesn't break anything.