Skip to content

CLI control utility for Gigabyte M32U monitors over USB (to not use OSD sidekick)

Notifications You must be signed in to change notification settings

kelvie/gbmonctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gigabyte Monitor control

Introduction

A CLI tool to change monitor settings over USB to the Gigabyte M32U

Supported monitors

  • Gigabyte M32U

In theory any Gigabyte Monitor that uses a Realtek HID device (presumably the M28U also uses this) to control it over OSD sidekick should have the same protocol, but this is the only one I own.

To install:

You’ll need libhidapi and libudev – on Debians that’s apt install libhidapi-dev libudev-dev, and on darwin you can use brew install hidapi

go install github.com/kelvie/gbmonctl@latest

Mac specific steps:

On Mac, you might run into an error like this when running the above command:

# github.com/sstallion/go-hid
/Users/dport/go/pkg/mod/github.com/sstallion/go-hid@v0.0.0-20190621001400-1cf4630be9f4/hid.go:38:10: fatal error: 'hidapi/hidapi.h' file not found
#include <hidapi/hidapi.h>
         ^~~~~~~~~~~~~~~~~
1 error generated.

This means go cannot find the headers / library for hidapi. To fix this, tell go where to find them. First, figure out where hidapi is:

$ brew info hidapi | grep files
/opt/homebrew/Cellar/hidapi/0.12.0 (19 files, 185KB) *

Now try to install gbmonctl like this:

CGO_CFLAGS='-I/opt/homebrew/Cellar/hidapi/0.12.0/include' CGO_LDFLAGS='-L/opt/homebrew/Cellar/hidapi/0.12.0/lib' go install github.com/kelvie/gbmonctl@latest

To use:

~ ~/go/bin/gbmonctl
ERROR: -prop or -propNum is required

Usage of gbmonctl:
  -n    Dry run: test commands and print instead
  -prop string
        Property to set. Available properties:
                brightness (0-100)
                contrast (0-100)
                sharpness (0-10)
                low-blue-light (0-10)
                        Blue light reduction. 0 means no reduction.
                kvm-switch (0-1)
                        Switch KVM to device 0 or 1
                colour-mode (0-3)
                        0 is cool, 1 is normal, 2 is warm, 3 is user-defined.
                rgb-red (0-100)
                        Red value -- only works if colour-mode is set to 3
                rgb-green (0-100)
                        Green value -- only works if colour-mode is set to 3
                rgb-blue (0-100)
                        Blue value -- only works if colour-mode is set to 3
  -propNum uint
        Property number to set instead of -prop
  -val int
        Value to set property to (default -1)

Examples:

# Set brightness to 50
gbmonctl -prop brightness -val 50

# Set contrast to 50
gbmonctl -prop contrast -v 50

# Set sharpness to 5
gbmonctl -prop sharpness -v 5

# Set colour temperature to 2700K for nighttime
gbmonctl -prop colour-mode -val 3
gbmonctl -prop rgb-red -val 100
gbmonctl -prop rgb-green -val 66
gbmonctl -prop rgb-blue -val 35

When using propNum, I don’t recommend using values that are out of the ranges listed, and this program doesn’t check, so I’m not liable for monitor damage that occurs from this.

Other notes

fwupd seems to delete the hidraw device that this uses, so you will have to disable fwupd and re-plug in your monitor (hit the KVM switch on the side), see #1

TO-DO

  • Get the rest of the commands
  • Make more user friendly

About

CLI control utility for Gigabyte M32U monitors over USB (to not use OSD sidekick)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages