Hacker News new | past | comments | ask | show | jobs | submit login

I recently put something together similar to this, to switch between my personal PopOS/Windows machine and my work Macbook Pro.

I used one of these manual USB switchers, (https://sabrent.com/products/usb-sw30), and connected its switch to a Raspberry Pi 4B via GPIO (4B is overkill by wanted hardwired network). There's a small separate keyboard (which will later be a macro keypad of some sort), connected to the Pi. Using inputexec (https://github.com/rbarrois/inputexec) to detect keypresses and then firing off a specific script to send a network request to the LG TV I use as a monitor to switch the source, and then set the GPIO connected to the USB switcher to high or low to switch the keyboard/mouse to the other machine.

I can also turn on/off the TV using the same WebOS API (and Wake-on-lan) as used during the source switch. A Kasa smart outlet also gets toggled to turn on/off a BenQ ScreenBar Halo (https://www.benq.com/en-us/lighting/monitor-light.html).

So with 4 different keypresses, I can switch to Work, to Personal, turn off monitor and light, and turn on monitor and light.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: