This Python library allows you to control the Gigabyte M27Q settings via USB. Feel free to contribute further settings.
The initial implementation was based on this gist.
On Linux you might be required to create a
udev
rule in, e.g./etc/udev/rules.d/10-local.rules
to allow USB traffic to the monitor with:
SUBSYSTEM=="usb", ATTRS{idVendor}=="2109", ATTR{idProduct}=="8883", MODE="0666"
.
This is a simple script to simulate the KVM switch button
from m27q import MonitorControl
with MonitorControl() as m:
m.toggle_kvm()