Lurker News
Simple KVM lets you control multiple PCs from one mouse, keyboard and monitor(s).

It is similar to Haimgel's display-switch (https://news.ycombinator.com/item?id=29608967), but it provides a GUI which hopefully makes it a bit easier to set up. It also supports hotkeys which effectively lets you alt+tab between computers.
I was surprised by the star-to-download ratio (55:400) on GitHub, so I thought I'd post it here as it might be useful to someone.
Feedback welcome!
Thanks, Fidel

Comments (181) 47 threads

Earlier comments
karolist3 replies#
Before settling back to one computer, I've done the cable replug thing manually, then used the urgreen USB switch as in the README then settled to using a monitor with built-in KVM switch, and it was the best. The problem is when you want one monitor for work and gaming - 4K (and/or high-refresh) KVM switches are incredibly expensive and tend to be unreliable, so what you usually do is use USB switches and switch input source on the monitor manually, the software here saves you clicking the "change input source" button, but seems to be Windows only, so unless both machines run Windows it'll be a one way switch and you'll have to resort to manual switch back.

The monitor that is suitable for gaming and has high DPI high refresh and built-in KVM switch is Gigabyte M28U, clicking one button switches input source and USB peripherials, works quite nicely, there's also M32U but with less DPI.

Kluggy2 replies#
Do the other computers detect the lack of a display when they're switched on the monitor?
karolist#
The monitor remains connected to the machine, the machine is unaware monitor is no longer using it as input source, but I assume this part, maybe there's some CEC notification firing.
vladvasiliu#
In my experience, this seems to depend on the monitor. On my LG, the computers think the monitor is still connected.
fiddyschmitt#
Nice one. Yes built-in KVMs are great. Btw - if you only have two computers, you can get away with running SimpleKVM on just one of them. Because it can detect a USB device being removed (ie. gone to the other computer) and inserted (arrived at this computer).
klohto1 reply#
the gigabyte m27u is even better panel and looks great with macOS due to high DPI
karolist#
Ah, good to know, I think it was not available when I bought mine. I would have preferred 27" to 28" due to DPI.
freewizard2 replies#
Nice project.

I wrote sth similar for myself, without requirement of USB switch or other hardware. it sends DDC command to HDMI/USB-C monitor and HID++ byte code to Logi MX keyboard and mouse.
Code is too messy to share but here's snippet if anyone want to write their own:

    hid_devices = [
        {
            'name': 'Logi Bolt Receiver',
            'receivers': hid.enumerate(0x046D, 0xC548),
            'command': [  # MX Keys Mini as first device on the receiver
                bytes([0x11, 0x01, 0x09, 0x1A, 0x00] + [0] * 15),  # change host to 1
                bytes([0x11, 0x01, 0x09, 0x1F, 0x01] + [0] * 15),  # change host to 2
                bytes([0x11, 0x01, 0x09, 0x1D, 0x02] + [0] * 15)]  # change host to 3
        }, {
            'name': 'Logitech Unified Receiver',
            'receivers': hid.enumerate(0x046D, 0xC52B),
            'command': [  # MX Anywhere 3 as first device on the receiver
                bytes([0x11, 0x01, 0x0A, 0x1A, 0x00] + [0] * 15),  # change host to 1
                bytes([0x11, 0x01, 0x0A, 0x1E, 0x01] + [0] * 15),  # change host to 2
                bytes([0x11, 0x01, 0x0A, 0x19, 0x02] + [0] * 15)]  # change host to 3
        }, {
            'name': 'MX Keys Mini Bluetooth',
            'receivers': hid.enumerate(0x046D, 0xB36E),
            'command': [
                bytes([0x11, 0xFF, 0x09, 0x1E, 0x00] + [0] * 15),  # change host to 1
                bytes([0x11, 0x01, 0x09, 0x1F, 0x01] + [0] * 15),  # change host to 2
                bytes([0x11, 0xFF, 0x09, 0x1D, 0x02] + [0] * 15)]  # change host to 3
        }, {
            'name': 'MX Anywhere 3 Bluetooth',
            'receivers': hid.enumerate(0x046D, 0xB025),
            'command': [
                bytes([0x11, 0xFF, 0x0A, 0x1A, 0x00] + [0] * 15),  # change host to 1
                bytes([0x11, 0x01, 0x0A, 0x1E, 0x01] + [0] * 15),  # change host to 2
                bytes([0x11, 0xFF, 0x0A, 0x19, 0x02] + [0] * 15)]  # change host to 3
        }
    ]
HankB991 reply#
Where could I explore this further? Are these sequences specific to the device?

My current setup includes two Dell monitors (U2415 with 2x HDMI "MHL" inputs and built in USB-3 hubs.) I'm using these with a Linux X86_64 desktop. I also use Logi vertical mouse and ATK (A.JAZZ) keyboard, both on Bluetooth and both also have dongles.
I would dearly love to use the keyboard/monitor/mouse on a Raspberry Pi 5 (BT and two micro-HDMI ports) with a pure S/W based solution rather than spending $$$ for a H/W KVM switch.
Thanks!
Edit: WRT messy code - no judgement, no shaming here. BTDT.

jespern#
This works for me:

  import hid

  VID = 0x046D
  HID = 0xB023 # 0xB35B

  if __name__ == "__main__":
      h = hid.device()
      h.open(VID, HID)
      h.set_nonblocking(1)

      # this works for keyboard
      # h.write([0x11, 0x01, 0x09, 0x1F, 0x01] + [0] * 15)

      # this works for mouse
      h.write([0x11, 0x01, 0x0A, 0x1E, 0x01] + [0] * 15)
      h.close()
fiddyschmitt#
Nice!!
dizhn3 replies#
There's a blog post about a similar thing but without any extra hardware. It uses barrier and a few simple scripts. (monitor does have to support switching via dcc).

It's not perfect especially since the input switching for the display is quite slow but there's leg in hardware kvms too.
https://xpufx.com/posts/hundred-percent-software-kvm-switch/

fiddyschmitt2 replies#
Yes Barrier is very nice. I would use it except for the fact that my work laptop is VPN'd and therefore on a different network to my home LAN.
0lde#
Barrier uses all IPs, so I use it with my VPN active but via my cross over cable at the library. If my USB WLAN devices supported ad Hoc mode, it would be over a permanent wireless link between the thinkpads.
PinkSheep#
You can override the default route of the VPN for the LAN.
fud1011 reply#
I'm using this solution atm. Works quite well except the barrier server on Linux is buggy and I need to frequently restart it.
dizhn1 reply#
Some ex barrier people cloned (as opposed to forking) the barrier repo and are continuing development on it. It's called input-leap.
fud1011 reply#
yeah, but even they recommend using barrier right? It's strange situation where the maintainers left the project to work on a project without users. It makes sense from a developer perspective though.

Continue this thread — 1 reply

liftm#
My monitor doesn't have dcc. I've worked around that part by activating automatic input selection and xset dpms force off'ing on the device I want to switch away from.
atomize2 replies#
My mid-range LG monitor has a built in KVM as well as PBP (picture by picture??) --- Whatever it stands for, I am able to split my 34 inch wide screen between my work Macbook and my personal computer (Linux) - I use an app that I've had forever called Synergy to share my mouse and keyboard between them seamlessly. You can even copy/paste across machines. I personally am hooked on my PBP widescreen+Synergy combo.
starkparker#
Yeah, PBP was a gamechanger. I got a Samsung with it without realizing and now use it almost exclusively.
bonton89#
I believe there are HDMI splitters on amazon that let you do this with any TV, although I'm not sure how great the quality of output is. I was looking at them once to see about doing split screen gaming with two different consoles.

Load more comments