Skip to content

Instantly share code, notes, and snippets.

@ssokolow
Created February 12, 2025 05:05
Show Gist options
  • Save ssokolow/01e8b9b6029f1a4c73b53b48aa5c770a to your computer and use it in GitHub Desktop.
Save ssokolow/01e8b9b6029f1a4c73b53b48aa5c770a to your computer and use it in GitHub Desktop.
Script to trigger a KVM switch on Linux by blinking Scroll Lock
#!/bin/bash
# Toggle the KVM switch programmatically by toggling the Scroll Lock LED
# Source: https://askubuntu.com/a/546989/23552
SLEEP=0.5
LEDNAME="Scroll Lock"
echo "Switching..."
xset led named "$LEDNAME"
sleep $SLEEP
xset -led named "$LEDNAME"
sleep $SLEEP
xset led named "$LEDNAME"
sleep $SLEEP
xset -led named "$LEDNAME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment