Make your keyboard follow the display colors.
- Add a proper color picking algorithm (like pywal's) instead of just averaging the colors. This often gives a bland grey color.
- Simple averaging algorithm
- Most used algorithm (picks the most used color in the screen)
- Further improvements can be made by making it add colors that are not precisely it, but close.
- Add wayland support.
- Make color transitions smoother.
- Add possibility to customize the delay of sending colors to the keyboard.
- Add benchmarks for every algorithm
Note that installing this will disable VIA!
- Install QMK following this guide.
- Run
qmk setup
. - Go into the
qmk_firmware
directory, and search for your particular keyboard in thekeyboards
(e.g.keyboards/keychron/q3/ansi
), CD into it. - Edit the
info.json
file to this:
{
...
"usb": {
"vid": "0xFEED",
"pid": "0x0000",
"device_version": "1.0.0"
}
...
}
- Be sure that
rules.mk
has this lines, if it doesnt't add them.
RGB_MATRIX_ENABLE = yes # If yours doesn't have this one already enabled, your keyboard might not support this
RAW_ENABLE = yes
- Edit
config.h
to the following:
#pragma once
// This allow the client to search for your keyboard
#define RAW_USAGE_PAGE 0xFF60
#define RAW_USAGE_ID 0x61
...
-
Almost there, you probably will see a lot of folders inside
keymaps/
, you can create a new one or just edit thedefault
one. -
Open
default/keymap.c
(or your custom directory name) and modify the keyboard layout as you please. -
Now append the contents of
firmware/keymap.c
(of this repo) to yourkeymap.c
-
Put your keyboard in bootloading mode, this changes from keyboard to keyboard, you can look here, inside the "Put Your Keyboard into DFU (Bootloader) Mode" section. You will notice you are in bootloader mode if your leds don't not turn on (at least that is the case for me).
-
Run
qmk flash -kb <here put your keyboard name, e.g. "keychron/q3/ansi"> -km default
. If you named your folder, instead of "default" insert its name.
You should have now flashed the firmware. If your keyboard hopefully turns on, you may see no change, it will snap into "ambience" mode after you follow the next step
If you are a nixos user you should be able to use the shell at client/shell.nix
fine, if you are not a nixos user, I can only point in the right direction.
You will probably have to download (names can vary from distro to distro) libhidapi-dev
and libx11-dev
.
You have three ways of installing the client
- If you use nixos, proper packaging will arrive someday.
- (Reccomended) If you have rust's cargo installed, you can
cd client/
and runcargo install --path .
, you will now haveqmk-ambience-client
as a binary on your system (if you set your PATH to include rust programs). - (Reccomended too) You can also
cd client/
and runcargo build --release
and runningtarget/release/qmk-ambience-client
. - You can pick the precompiled binary in the releases tab (if I remember to upload it).
You can run the client with just this:
# \/ the binary changes depending on you installed the client
qmk-ambience-client
This is the simplest and fastest one, but the one I think looks worse.
qmk-ambience-client --algorithm simple-average
This picks the most used color, it's slower then the simple average but still very fast.
It also counts the pixels with an actual color (not white/black) and brighter, as more pixels, this makes it actually very accurate.
qmk-ambience-client # you can also set `--algorithm most-used` but it's already the default
The default delay between each color average calculation can be set with the --ms
flag. By default it's 500 milliseconds.
qmk-ambience-client --ms 200