- Rust 61.4%
- QML 37.6%
- Shell 1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| core | ||
| data | ||
| packaging/arch | ||
| qml | ||
| src | ||
| .gitignore | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| PRODUCT.md | ||
| README.md | ||
qtrogkey
A Linux configurator for the ASUS TUF Gaming K3 Gen II Hatsune Miku Edition
(wired USB, 0b05:1c5e; the 0b05:1c60 revision is accepted too), covering what
ASUS's Armoury Crate does on Windows:
- Lighting: the ten onboard effects (static, breathing, color cycle, reactive, wave, ripple, starry night, quicksand, current, rain drop) with their colors, random colors, speed, direction and brightness. Effects apply live and are saved to the keyboard.
- Per-key colors: paint keys on a picture of the keyboard (click, drag, right-click to pick a key's color, or arrow keys and Space).
- Profiles: switch between the five onboard profiles; lighting and key assignments belong to the active profile. Profile switches made with the keyboard's Fn shortcuts show up in the app.
- Key assignment: remap any key except Fn to another key, a media or mouse action; put a common shortcut or a macro on F1–F8 (the keyboard stores shortcuts and macros only on those keys).
- Macros: record key presses and keep a library of macros.
The keyboard cannot report its lighting or assignments back, so the app shows what it set itself; an effect picked with the keyboard's own Fn shortcuts is not reflected.
Tested on the keyboard
On a K3 Gen II Miku Edition (0b05:1c5e, firmware 00.01.03), through the app:
per-key colors and painting, key remapping, recording a macro and putting it on
F2, saving to the keyboard (assignments and effects survive a profile switch),
profile switching, and the Static, Wave, Ripple, Quicksand and Starry night
effects. Breathing, Color cycle, Reactive, Current and Rain drop are accepted by
the keyboard but were not checked by eye.
Written in Rust with a Qt Quick (QML) interface through
CXX-Qt. The device code (core/) has no Qt
dependency.
Building
Needs Rust 1.88 or newer, Qt 6 with Qt Quick Controls and Qt Quick Dialogs, and hidapi with the hidraw backend.
| Distribution | Packages |
|---|---|
| Arch | qt6-base qt6-declarative hidapi |
| Debian/Ubuntu | qt6-base-dev qt6-declarative-dev qml6-module-qtquick-controls qml6-module-qtquick-dialogs qml6-module-qtquick-layouts libhidapi-dev |
| Fedora | qt6-qtbase-devel qt6-qtdeclarative-devel hidapi-devel |
cargo build --release
The program is target/release/qtrogkey.
Access to the keyboard
Linux lets only root open the keyboard's settings channel. The udev rule in
data/70-qtrogkey.rules gives the person at the computer access:
sudo install -m 644 data/70-qtrogkey.rules /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger --subsystem-match=hidraw
Until it is installed, the app explains this and offers the same commands.
Arch / CachyOS package
With base-devel and a Rust toolchain installed, build a package from this local
checkout:
cd packaging/arch
./make-source.sh
makepkg -si
The source helper creates a snapshot containing the Cargo lockfile, Rust/QML
sources and desktop assets, excluding build artifacts. There is no upstream
download URL yet, so the PKGBUILD uses that local archive and skips its checksum.
Run the helper again after changing the source; use makepkg -Cfsi for a clean
rebuild of the same version.
The package installs the binary, desktop entry, icon, documentation and udev rule
in the standard system locations. Its udev rule is in
/usr/lib/udev/rules.d/70-qtrogkey.rules; after the first install, reload the rules
as above and reconnect the keyboard if access is not granted immediately.
Installing
sudo install -m 755 target/release/qtrogkey /usr/local/bin/
sudo install -m 644 data/io.github.qtrogkey.desktop /usr/local/share/applications/
sudo install -m 644 data/io.github.qtrogkey.svg /usr/local/share/icons/hicolor/scalable/apps/
Per-key colors after a power cycle
Onboard effects live on the keyboard. Per-key colors do not: the keyboard
forgets them when it loses power, and qtrogkey sends them again when it starts.
qtrogkey --apply does only that and exits; the switch Restore per-key colors
when I log in on the Device page adds it to your session's autostart.
Settings
Lighting per profile, key assignments and macros are stored in
~/.config/qtrogkey/settings.json, because the keyboard cannot report them back.
Credits and license
The keyboard protocol is known from OpenRGB
(AsusAuraTUFKeyboardController) and G-Helper
(AsusKeyboard, key layouts). Not affiliated with ASUS.
qtrogkey is free software under the GNU General Public License, version 3 or later. See LICENSE.