Skip to content

Latest commit

 

History

29 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loq-rgb

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.

Building and installing

Build dependencies

  • pkg-config
  • libusb-1.0
    • libusb-1.0.0-dev (Ubuntu/Debian)
    • libusb1-devel (Fedora)
    • libusb (Arch)
    • libusb-devel (Void)
    • or your distro's equivalent package

Building

  • make all
  • executable placed in the bin subdirectory

Installing

  • sudo make install to install system-wide to /usr/local/bin
  • make install PREFIX="$HOME/.local" to install user-locally to ~/.local/bin

Usage

loq-rgb [OPTIONS]

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
    • 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

AI disclosure

REAL rating: 3

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: libusb function calls and arguments, packet structure
  • src/util/options.h: rgb_mode_t and brightness_t enum values
  • src/util/options.c: parse_rgb function body

All other code is my own original work.

Credit

Technical details come from 4JX/L5P-Keyboard-RGB. This project is, effectively, a partial C rewrite.

About

Small utility for controlling the keyboard RGB on (some) Lenovo LOQ and Legion laptops

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages