Small Linux command line utility to control the RGB of the keyboard on (at least some) Lenovo LOQ and Legion laptops with 4-zone RGB.
pkg-configlibusb-1.0libusb-1.0.0-dev(Ubuntu/Debian)libusb1-devel(Fedora)libusb(Arch)libusb-devel(Void)- or your distro's equivalent package
make all- executable placed in the
binsubdirectory
sudo make installto install system-wide to/usr/local/binmake install PREFIX="$HOME/.local"to install user-locally to~/.local/bin
loq-rgb [OPTIONS]
-m<MODE>,--mode=<MODE>- Sets the RGB mode
<MODE>must be one of:static,breath,wave,smooth- Default:
static
-s<SPEED>,--speed=<SPEED>- Sets the speed of animated modes
<SPEED>should be an integer in the range 1-4- other values will be clamped to the range
- Note: does nothing in mode
static - Default:
1
-b<BRIGHTNESS>,--brightness=<BRIGHTNESS>- Sets the brightness level
<BRIGHTNESS>must be one of:low,high- Default:
low
-1<COLOR>,--zone1=<COLOR>-2<COLOR>,--zone2=<COLOR>-3<COLOR>,--zone3=<COLOR>-4<COLOR>,--zone4=<COLOR>- Sets the color of the corresponding zone
<COLOR>must be a valid RGB hex code- may be prefixed with
#, also accepted without prefix
- may be prefixed with
- Note: does nothing in modes
wave,smooth - Default:
#ffffff
-v,--verbose- Increases output log verbosity
- May be repeated multiple times
-h,--help- Prints a help message and exits
Some sections of this piece of software were written with use of an LLM.
The majority of the code is purely human-authored, but some sections were in part generated by an LLM. All such sections were afterwards still heavily scrutinised and edited by a human.
The following is a comprehensive list of what has been aided by an LLM:
src/main.c:libusbfunction calls and arguments, packet structuresrc/util/options.h:rgb_mode_tandbrightness_tenum valuessrc/util/options.c:parse_rgbfunction body
All other code is my own original work.
Technical details come from 4JX/L5P-Keyboard-RGB. This project is, effectively, a partial C rewrite.
