https://github.com/grieferatwork/msi-kbrgb
A single-source-file C program to set the colors of a 3-region MSI keyboard.
https://github.com/grieferatwork/msi-kbrgb
c color commandline keyboard laptop msi notebook rgb
Last synced: 9 months ago
JSON representation
A single-source-file C program to set the colors of a 3-region MSI keyboard.
- Host: GitHub
- URL: https://github.com/grieferatwork/msi-kbrgb
- Owner: GrieferAtWork
- License: unlicense
- Created: 2020-06-20T19:15:12.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-21T08:58:00.000Z (almost 6 years ago)
- Last Synced: 2025-08-22T22:50:39.452Z (10 months ago)
- Topics: c, color, commandline, keyboard, laptop, msi, notebook, rgb
- Language: C
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# msi-kbrgb
A single-source-file C program to set the colors of a 3-region MSI keyboard.
# Disclaimer
I did not reverse engineer the /magic/ used here myself. And looking around github in regards to the subject of home-made programs to set the colors of these keyboard, there's already more than one of them. However, none of the ones I managed to find were what this repo now holds: A simple, single-source-file, (probably portable), commandline C program with minimal dependencies
# The Magic
There really isn't too much to it, but you can just look between the `/* BEGIN: Magic */ ... /* END: Magic */` regions to take a look at the /magic/ constants and command sequences that must be sent to an HID device `vendor_id: 0x1770, product_id: 0xff00`
# Usage
The program is self-documenting, and you can run `kbrgb --help`, but here are some examples:
- `kbrgb m:normal p:all:green:h` (Make the whole keyboard green)
- `kbrgb m:normal p:l:red:h p:m:green:h p:r:blue:h` (Make the whole keyboard RGB (RedGreenBlue))
- ...
# Dependencies
You will need to have installed:
- A couple of standard-C headers (see top of `main.c`)
- [`hidapi`](https://github.com/signal11/hidapi)
- If you're using cygwin (like me), you don't even have to install this one from source.
Instead, from the cygwin installer, install the following packages:
- `libhidapi-devel`
- `libhidapi0`
And that's it
# Building
Just run `make` from the cloned repo, or do your own `gcc -o kbrgb main.c -lhidapi` (after all: it's only a single source file)
# Tipps
Since (at least for my laptop), the default color of the keyboard is all-red after boot (and I have yet to find a way of changing this), I've had the quite neat idea of setting up scheduled tasks to run the following:
- During logon: `kbrgb m:normal p:all:green:h`
- During logoff: `kbrgb m:normal p:all:red:h`
Meaning that while I'm logged in, the keyboard is green, but while I'm logged off, it's red (and since red is the default color, it will also be red until I log on for the first time)
I think that's rather neat :)