All Projects → 4JX → L5P-Keyboard-RGB

4JX / L5P-Keyboard-RGB

Licence: other
Cross platform software to control the lighting of the 4 zone keyboard included in the 2020 and 2021 lineup of the Lenovo Legion laptops. Works on Windows and Linux.

Programming Languages

rust
11053 projects
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to L5P-Keyboard-RGB

Hyperapp Fx
Effects for use with Hyperapp
Stars: ✭ 105 (+32.91%)
Mutual labels:  keyboard, effects
ackermann-drive-teleop
ROS keyboard and joystick teleoperation scripts for robots with ackermann steering
Stars: ✭ 33 (-58.23%)
Mutual labels:  keyboard
mirrorboard-mac
Intuitive one-handed typing on macOS by mirroring the keyboard while spacebar is held
Stars: ✭ 29 (-63.29%)
Mutual labels:  keyboard
input-modifier
uinput based key bindings and macros tool for Linux
Stars: ✭ 17 (-78.48%)
Mutual labels:  keyboard
V60Mini-firmhack
A project to disassemble the KBParadise V60 Mini keyboard firmware.
Stars: ✭ 23 (-70.89%)
Mutual labels:  keyboard
NNAOTest
Neural Network Ambient Occlusion for Unity
Stars: ✭ 72 (-8.86%)
Mutual labels:  effects
GKey
German Keyboard Layout for TempleOS
Stars: ✭ 20 (-74.68%)
Mutual labels:  keyboard
kindaVim.theapp
Ultimate Vim Mode for macOS
Stars: ✭ 372 (+370.89%)
Mutual labels:  keyboard
kint
kinT keyboard controller (Kinesis controller replacement)
Stars: ✭ 191 (+141.77%)
Mutual labels:  keyboard
purescript-smash
An "extensible coeffect" system built out of comonads and Day convolution.
Stars: ✭ 36 (-54.43%)
Mutual labels:  effects
SulfurKeyboard
Android Gingerbread Keyboard with Myanmar(Zawgyi-one) Language
Stars: ✭ 18 (-77.22%)
Mutual labels:  keyboard
NavilIME
Windows Hangul (Korean) Input Method Editor based on TSF
Stars: ✭ 79 (+0%)
Mutual labels:  keyboard
persian
Some utilities for Persian language in Go (Golang)
Stars: ✭ 65 (-17.72%)
Mutual labels:  keyboard
nucular-keyboard
USB Keyboard Adapter for old ThinkPad keyboards
Stars: ✭ 27 (-65.82%)
Mutual labels:  keyboard
prk firmware
A keyboard firmware platform in PicoRuby
Stars: ✭ 337 (+326.58%)
Mutual labels:  keyboard
ukrainian-typographic-keyboard
Combined Ukrainian keyboard layout with typographic symbols
Stars: ✭ 356 (+350.63%)
Mutual labels:  keyboard
NumPad
Number Pad (inspired by Square)
Stars: ✭ 81 (+2.53%)
Mutual labels:  keyboard
arduino-audio-tools
Arduino Audio Tools (Music Player, Music Recorder supporting I2S, Microphones, DAC, ADC, A2DP, Url, MP3, AAC, AudioKit, ES8388)
Stars: ✭ 393 (+397.47%)
Mutual labels:  effects
MarsAdmin
MarsAdmin v7 is a general interface add-on which will help staff member ingame for trinity core.
Stars: ✭ 13 (-83.54%)
Mutual labels:  legion
xcloud-keyboard-mouse
Chrome extension for controlling Xbox Cloud Gaming (Project xCloud) using a keyboard and mouse
Stars: ✭ 78 (-1.27%)
Mutual labels:  keyboard

Latest Version Build Status Support Server Donate

Legion RGB Control

Preview

Index

Download

⚠️ Use at your own risk, the developer is not responsible for any damages that may arise as a result of using this program.

Builds will be periodically uploaded to the releases tab.

You may also download pre-compiled versions from here (requires github account) by clicking the latest entry with a and going under the "artifacts" section.

Available effects

All stock effects: Static, Breath, Smooth, LeftWave, RightWave.

Custom effects:

  • Lightning: Adds a little spark.
  • AmbientLight: Reacts to content on your screen.
  • Smooth(Left/Right)Wave: An implementation of the classic wave effect.
  • (Left/Right)Swipe: Transitions the selected colors from side to side, useful for custom waves.
  • Disco: A portable dance floor!
  • Christmas: Even keyboards can get festive.
  • Fade: Turns off the keyboard lights after a period of inactivity.
  • Temperature: Displays a gradient based on the current CPU temperature. (Linux only)

Creating your own effects

The best way to add a new effect is to directly edit the source code, as it allows the most flexibility. You can however also use the built-in feature to make basic effects.

At a glance

  • You can make custom effects using a json file with the following format:
{
 "effect_steps": [
  {"rgb_array": [0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 0, 0], "step_type": "Set", "speed": 1, "brightness": 1, "steps": 100, "delay_between_steps": 100, "sleep": 100},
  {"rgb_array": [0, 100, 0, 0, 0, 200, 0, 0, 200, 200, 0, 0], "step_type": "Transition", "speed": 1, "brightness": 1, "steps": 100, "delay_between_steps": 100, "sleep": 100}
 ],
 "should_loop": true
}

File sections

  • effect_steps: Contains the different "steps" the effect will go through.
    • rgb_array: An array describing the colours to use in the [r,g,b,r,g,b...] format.
    • step_type: The type of step to use. You may instantly swap the colours with Set or smoothly transition to them with Transition.
    • speed: Currently unused.
    • brightness: The brightness of the step, can be 1 (low) or 2 (high).
    • steps: To smoothly transition between colours, the keyboard LEDs are set at small intervals until they reach the desired color. This controls the number of them.
    • delay_between_steps: How much time to wait between each interval (In ms).
    • sleep: The time to wait before going to the next effect_step (In ms).
  • should_loop: Whether the effect should start again once it reaches the last effect.

Usage

Note: By default, on Linux you will have to run the program with root privileges, however, you can remedy this by adding the following udev rule:

  • 2021 Models:
# /etc/udev/rules.d/99-kblight.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="048d", ATTR{idProduct}=="c965", MODE="0666"
  • 2020 Models:
# /etc/udev/rules.d/99-kblight.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="048d", ATTR{idProduct}=="c955", MODE="0666"

And then reloading the rules:

sudo udevadm control --reload-rules && sudo udevadm trigger

With GUI

Execute the file by double-clicking on it or running it from a console without arguments.

Via the command line

Usage:

legion-kb-rgb [OPTIONS] [SUBCOMMAND]

Examples:

  • Getting the help prompt
legion-kb-rgb --help
  • Setting the keyboard to red
legion-kb-rgb Static 255,0,0,255,0,0,255,0,0,255,0,0
  • Using the SmoothWave effect going to the left with speed 4 and brightness at high
legion-kb-rgb -s 4 -b 2 -d Left SmoothWave

Compatibility

This program has been tested to work on the 4 zone keyboard of the Legion 5 2020, Legion 5 2021 and Legion 5 Pro models on both Windows and Linux.

"How about X model"

  • Legion 7(i): Won't work, the backlight on these is per-key and uses a different way of communicating.
  • Any variant with a white backlight: Haven't figured out how to talk to this one yet, but given the limited number of states (off, low, high) there's not many effects I'd be able to add anyways.

Building from source

Prerequisites

  • Rust
  • Git
  • Ninja
    • If building fltk-rs with the use-ninja feature. (On by default)
  • On Linux, you'll need additional dependencies:

Ubuntu

sudo apt-get update && sudo apt-get install -y libpango1.0-dev libx11-dev libxext-dev libxft-dev libxinerama-dev libxcursor-dev libxrender-dev libxfixes-dev libudev-dev nasm libxcb-randr0-dev libusb-1.0-0-dev libdbus-1-dev

Arch Linux

sudo pacman -S nasm cmake

Using cargo-make

Works on both Windows and Linux.

  • Install cargo-make
cargo install cargo-make
  • Clone the repository
git clone https://github.com/4JX/L5P-Keyboard-RGB.git
  • Build the project
cd L5P-Keyboard-RGB/
cargo make build-release

Building manually

  • Download and bootstrap VCPKG
    • You'll need to set an environment variable called VCPKG_INSTALLATION_ROOT pointing to the directory where you downloaded and bootstrapped VCPKG.

Windows

  • Download the necessary dependencies
vcpkg update && vcpkg install libvpx:x64-windows-static libyuv:x64-windows-static
  • Clone the repository
git clone https://github.com/4JX/L5P-Keyboard-RGB.git
  • Build the project
cd L5P-Keyboard-RGB/
cargo build --release

Linux

  • Download the necessary dependencies
vcpkg update && vcpkg install libvpx libyuv
  • Clone the repository
git clone https://github.com/4JX/L5P-Keyboard-RGB.git
  • Build the project
cd L5P-Keyboard-RGB/
cargo build --release

Crashes, freezes, etc

I cannot guarantee this solution will work for anyone but myself. That being said feel free to open an issue if you encounter any of these problems on the issues tab.


Thanks to legendk95#0574 (272711294338072577) over at discord for initially reverse engineering the way to talk to the keyboard.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].