For some reason the „Scroll Lock“ button doesn’t work in an Xsession in Ubuntu. There is an Bug Report in Lunchpad.
My KVM-Switch uses the Scroll Lock Key to switch. You can emulate the key with this command:
xset led 3 && sleep 0.2 && xset -led 3
This enables the Scroll Lock and disable it after a short sleep. This simulates a double press of „Scroll Lock“.
Execute it in a Terminal and the KVM-Switch should switch to your other computer.
I created a small script „/usr/bin/kvmswitch.sh“:
#!/bin/bash xset led 3 && sleep 0.2 && xset -led 3
Now go to Settings, Keyboard, Keyboard Shortcuts and create a custom keyboard shortcut which executes „/usr/bin/kvmswitch.sh“.
I used STRG+Scroll Lock for example. ( You can’t use only „Scroll Lock“ as hotkey ! )
Terry
19 Feb 2016Very helpful, thanks. For some reason on my particular KVM I had to do the above twice, as in
xset led 3 && sleep 0.2 && xset -led 3 && sleep 0.2 && xset led 3 && sleep 0.2 && xset -led 3
all on one line.
The KVM’s on a Raspberry PI, BTW.