Giter VIP home page Giter VIP logo

gbmonctl's Introduction

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/[email protected]/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 kelvie#1

TO-DO

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

gbmonctl's People

Contributors

kelvie avatar banool avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.