Skip to content

Instantly share code, notes, and snippets.

@r0xsh
Last active June 4, 2024 14:10
Show Gist options
  • Save r0xsh/8dbaf16231ad01028a255bd80bcbd7f9 to your computer and use it in GitHub Desktop.
Save r0xsh/8dbaf16231ad01028a255bd80bcbd7f9 to your computer and use it in GitHub Desktop.
Software KVM

This is a software to extand the capabilities of a USB Switch Hub. It use the protocol DDC/CI to change the input of my monitor. I'm using the UGREEN Switch USB 3.0

ACTION=="remove", SUBSYSTEM=="usb", ATTRS{idVendor}=="05e3", ATTRS{idProduct}=="0610", RUN+="switch_screen.sh pc"
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="05e3", ATTRS{idProduct}=="0610", RUN+="switch_screen.sh laptop"
#!/bin/env sh
PORT=8
PC=0x0f
LAPTOP=0x11
function switch_screen {
nohup ddcutil -b $PORT setvcp 60 $1 --noverify &>/dev/null &
}
case "$1" in
laptop) switch_screen $LAPTOP ;;
pc) switch_screen $PC ;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment