GithubHelp home page GithubHelp logo

4jx / l5p-keyboard-rgb Goto Github PK

View Code? Open in Web Editor NEW
275.0 6.0 40.0 2.09 MB

Cross platform software to control the RGB/lighting of the 4 zone keyboard included in the 2020, 2021, 2022 and 2023 lineup of the Lenovo Legion laptops. Works on Windows and Linux.

License: GNU General Public License v3.0

Rust 93.89% Nix 6.11%
rust lenovo-legion keyboard lenovo effects legion egui

l5p-keyboard-rgb's People

Contributors

4jx avatar drakanio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

l5p-keyboard-rgb's Issues

Todo list

  • Fade but per zone
  • Speed input for effects clamped for stock ones
  • Maybe improve ripple
  • Saving ripple apparently loads as static
    • File does save as ripple*

Suggestion: Start program while being minimized to system tray

As shown in the title, a toggle which can start the application but by putting it on the system tray so it can be opened from there, ideal for startup when booting up the machine just not to make the setting console to stay there unless i click the red X or by minimizing it, it can make things cleaner

Win11 compatibility

Does not start in Win11 at all. Crashes at launch.
Don't know if there is something more I need to install?

Asking For launch

Question?

The application is compiled and it's a success.. The main Question is how to run the application for the first time.?

System Info:

My current device is Lenovo Legion 7 Slim.
Specification are:

  • 16GB Ram
  • 512 SSD
  • Pure Arch Linux
  • AMD Ryzen 7 5800H
  • Nvidia RTX 3060

App stopped working

I had the rainbow wave issue on my new Legion 5 Pro. But your app worked on the first try and I was able control the RGB lights. But just yesterday it stopped working. It work a few weeks in then it stopped. I would click on the legion-kb-rgb app but it did nothing. Clicked several times, but it's window would show ghost of it for a split second. Then I tried deleting it all and downloaded it again, with your latest update. It still did the same thing and kept clicking on it until a window popped up saying "Another instance of the program is already running, please close it before starting a new one" (see screenshot attached). Please note I know little about using command prompt but willing to try make this work.
Screenshot (2)
.

how to auto run

lights effects looks crazy,but how do i auto run the program with the last saved light settings

Task closes itself after waking up the machine from sleep

Im just seing that the program closes itself after one or two suspend action of windows, dont know what is happening but everytime i wake up my laptop from sleep, the program quits itself and stop running, having to open it again to summon the custom lightning

Won't run on Archcraft Linux

Problem
Every time I try to run this as a non-root userI get the following error:

floating point exception (core dumped)

I have added the needed udev rule and reloaded the rules, so I'm not sure why it won't launch. However, it does work when I run it as root. Although that gives me this error:

pango_font_description_set_absolute_size: assertion 'desc != NULL' failed

Notes
I checked to see if pango was installed, and version 1.50.7.1 is present

I didn't build from source, instead I used the zip archive

I'm not sure what to do at this point besides trying to build from source and seeing if that works. Any other suggestions?

Disco

Chooses a random color and updates one of the zones with it, repeats in a loop

Add keyboard

Hi.
Please add keyboard
Bus 003 Device 011: ID 048d:c101 Integrated Technology Express, Inc. ITE Device(8910)
Lenovo Legion 5 Pro 16ITH6H 82JD000MRU

print lsusb:

Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 011: ID 048d:c101 Integrated Technology Express, Inc. ITE Device(8910)
Bus 003 Device 003: ID 09da:7e25 A4Tech Co., Ltd. USB Device
Bus 003 Device 013: ID 8087:0026 Intel Corp. AX201 Bluetooth
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Thank you

Christmas theme

Can you create a christmas theme? Something that cycles between red and green maybe?

It would also be prettry cool if you can create your own effects

My RGB is stuck

2 days ago I started using this software, it was great until today when the RGB animation suddenly stopped and I'm stuck with a static RGB that I cannot control.
I force-stopped the RGB app and tried to open it again but I got a message saying:
"A valid keyboard model was not found. It may be due to a hardware error."
when I open Lenovo vantage and try changing the RGB from there it says:
"Driver Install Required .. install driver to activate lighting (Reboot Required)"
I tried restarting the pc but the RGB was stuck even in BIOS! and I couldn't turn it off or change it with Fn+Spacebar.
At last, I restored a system image which was 1 year old and which completely removed the old windows, but the same exact problem still exists!
here is the spec sheet:
https://psref.lenovo.com/Detail/Legion/Lenovo_Legion_5_15ARH05H?M=82B1005FAX
I hope that the problem can be solved and that the application didn't brick my RGB somehow, and thanks!

Edit: my last resort was to press the "NOVO button" with a paper clip, that button is like an "emergency" button used to boot up the laptop for the first time or if the boot failed, the RGB came back to normal and the problem is fixed!!!
I still dont know why this problem happened in the first place i will inform you if it happened again.

Actually make it work on Linux

DEVICE_INFO = (0x048d, 0xc964, 0, 0)

Cargo.toml > features=["linux-static-libusb"]

Needs to be run as root with sudo.

Initiating the tool with windows through task scheduler breaks function keys apparently

I just want to leave a experience with the app, maybe is just my fault, i wanted the app to run exactly at the time the machine turn on so i dont have to manually open it everytime i log in, so i created a task in task scheduler to open the app as soon as the machine boots up, before i log in (so i had to type administrator password to create the task).

Next time my machine booted up, apparently the function keys like brightness control, airplane mode, microphone, touchpad toggle and lenovo special key stopped working, also the status LED for the num lock key got stuck and it couldnt turn it off even if the num pad wasnt active, same goes for the caps lock, which was the opposite, it couldnt turn on even if the caps lock was active.

Volume keys, num lock, caps lock worked fine, and the Fn Lock in Esc key worked only if i turn it on through software, and i can even control the normal rgb as usual through the app and lenovo vantage software, the only thing broken was the rest of the Fn Keys and the Status LED on some.

Maybe it was just my bad but the only way to solve this problem, i had to do a factory reset, contacted lenovo support and they brought me a tool to reinstall windows from scratch, so the problem was solved there, a little advice to someone who could do the same, and this thing happened, so if anyone with their 5 pro could try this (if the issue exists you may have to factory reset the laptop using the lenovo recovery key to fix it) and confirm this issue since i dont want to factory reset my 5 pro again, so the dev can make a failsafe in this regard if that was the case or not because im dumb enough to do that kind of stuff

Unable to compile with cargo build

When doing cargo build it complains about

"error: failed to run custom build command for `scrap v0.5.0"

Here is the full log

#RUST_BACKTRACE=full cargo build

Compiling fltk-sys v1.1.16
Compiling scrap v0.5.0 (/media/X/t/L5P-Keyboard-RGB-0.7.0/libs/scrap)
error: failed to run custom build command for scrap v0.5.0 (/media/X/t/L5P-Keyboard-RGB-0.7.0/libs/scrap)

Caused by:
process didn't exit successfully: /media/X/t/L5P-Keyboard-RGB-0.7.0/target/debug/build/scrap-e71d258a2e2dc590/build-script-build (exit code: 101)
--- stderr
thread 'main' panicked at 'called Result::unwrap() on an Err value: NotPresent', libs/scrap/build.rs:7:63
stack backtrace:
0: 0x5566196b6781 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hc07c9cd6473c184f
1: 0x5566196e15ec - core::fmt::write::hd5abae825e92a210
2: 0x5566196c2187 - std::io::Write::write_fmt::h3f63b42f66032676
3: 0x5566196bdce2 - std::panicking::default_hook::{{closure}}::h9451e4f30330b478
4: 0x5566196bd9ab - std::panicking::default_hook::hccf5200ac295eadd
5: 0x5566196be31a - std::panicking::rust_panic_with_hook::h8d53767150680421
6: 0x5566196bdefb - rust_begin_unwind
7: 0x5566196ee281 - core::panicking::panic_fmt::h59908d1ffbada4a3
8: 0x5566196ee313 - core::result::unwrap_failed::h90156c5ceff9b971
9: 0x5566190a2eb7 - core::result::Result<T,E>::unwrap::h3a90bebaed428072
at /tmp/rustc-1.46.0-src/src/libcore/result.rs:1005
10: 0x55661909d95d - build_script_build::find_package::hd12a8f01cc37db73
at libs/scrap/build.rs:7
11: 0x55661909fa5b - build_script_build::main::h32c56f700991bd73
at libs/scrap/build.rs:86
12: 0x5566190a2b5b - std::rt::lang_start::{{closure}}::h2d70ff4dcd9d85d6
at /tmp/rustc-1.46.0-src/src/libstd/rt.rs:67
13: 0x5566196bbb45 - std::rt::lang_start_internal::h50104ee6cf97d478
14: 0x5566190a2b34 - std::rt::lang_start::h572ea5d604fdc3d4
at /tmp/rustc-1.46.0-src/src/libstd/rt.rs:67
15: 0x55661909fbda - main
16: 0x7f58cf3697d0 - __libc_start_main
17: 0x55661909d379 - _start
at ../sysdeps/x86_64/start.S:108
18: 0x0 -
warning: build failed, waiting for other jobs to finish...
error: build failed

Add license

Hey, I'd like to package this project for Nix and would appreciate it if you could specify a license. :)

Crash when inputting numbers in boxes in GUI mode

When inputting numbers into the boxes, this application often crashes in GUI mode. These boxes can also be resized left or right, which is definitely not supposed to happen. Here is the crash log.

No subcommands found, starting in GUI mode. To view the possible subcommands type "legion-kb-rgb --help".
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: Unknown("An unknown error occurred!")
Location: src/gui/app.rs:102

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 8 frames hidden ⋮                               
   9: legion_kb_rgb::gui::app::App::start_ui::h850c2f7f08740869
      at <unknown source file>:<unknown line>
  10: legion_kb_rgb::cli::try_cli::h269fff4a84552eb4
      at <unknown source file>:<unknown line>
  11: legion_kb_rgb::main::h4795929818dda366
      at <unknown source file>:<unknown line>
  12: std::sys_common::backtrace::__rust_begin_short_backtrace::he9e2516d859af302
      at <unknown source file>:<unknown line>
  13: std::rt::lang_start::{{closure}}::h218a02376d1f626e
      at <unknown source file>:<unknown line>
  14: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h5f1ba3b861cac230
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/core/src/ops/function.rs:280
  15: std::panicking::try::do_call::h4febfdb770eca39d
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492
  16: std::panicking::try::h8b0eac8a7d726dbf
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456
  17: std::panic::catch_unwind::h11b83c489c0d8394
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137
  18: std::rt::lang_start_internal::{{closure}}::h63502d2988634103
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128
  19: std::panicking::try::do_call::h4be475cff12d2aae
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:492
  20: std::panicking::try::h1a3b25b8eaf9ba31
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panicking.rs:456
  21: std::panic::catch_unwind::h224588ada67b9b0b
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/panic.rs:137
  22: std::rt::lang_start_internal::h2807b375c1959759
      at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library/std/src/rt.rs:128
  23: main<unknown>
      at <unknown source file>:<unknown line>
  24: __libc_start_call_main<unknown>
      at <unknown source file>:<unknown line>
  25: __libc_start_main_impl<unknown>
      at <unknown source file>:<unknown line>
  26: _start<unknown>
      at <unknown source file>:<unknown line>

"Minimize" to tray

Separate GUI from the main thread so the program keeps running with it closed/some form of a hide button

Add a tray icon with options to show the UI and close.

Make a library

It would be really nice if there was a library for this one could use in one's own projects without the performance hit of running a separate program for each effect.
(My intended target platform would be Unity on Linux and Windows)

Legion 7 16ACHg6 | Support

Hi there,

I have a Legion 7 16ACHg6 and would like to add support for my keyboard. Is there any additional information you need?

Rewrite UI code

Its one big rushed spaguettio as it stands.

  • Define the structure of the AppUI struct first (for latter adding of event handling) and then go onto coding it all.

    • "Solved" by removing it entirely since it was not needed due to change nº 2
  • Main should not be registering anything related to the UI, it should be getting the finished app and running it. (Aka it should not depend on the UI to run, you should be able to directly control the Keyboard struct without having to delete 80% of the code there)

  • Get rid of that weird tuple.

  • #4

  • Attempt to "merge" event handling code + make it prettier and easier to follow.

  • Use sender/reciever instead of "signal variables" for custom effects(?)

    • Not quite there, but AtomicBools will do the job

Trojan

Windows security (on win 11) detects a trojan on v0.8.1

Trouble building on Linux

I had a trouble running the app on linux and it gave me

The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: DeviceNotFound
Location: src/cli.rs:74

DeviceNotFound gets thrown from here

 api
		.device_list()
		.find(|d| {
			let info_tuple = (d.vendor_id(), d.product_id(), d.usage_page(), d.usage());
			info_tuple == DEVICE_INFO_2021 || info_tuple == DEVICE_INFO_2020 || info_tuple == DEVICE_INFO_IDEAPAD_2021
		})
		.ok_or(error::Error::DeviceNotFound)?;

I was trying to compile the code to see why it couldn't recognize my device. After installing a ton of dependencies it succeeds to build but fails to run a custom build command failed to run custom build command for scrap v0.5.0 (/home/kyle/Apps/projects/L5P-Keyboard-RGB/libs/scrap).

That scrap script is saying Failed to find package: VcpkgNotFound("No vcpkg installation found. Set the VCPKG_ROOT environment variable or run 'vcpkg integrate install'")', libs/scrap/build.rs:7:45. `

vcpkg is apparently a Windows thing so how can I get this work on Linux?

Effects that don't use colors don't work in CLI

OS: Windows 11

Effects such as AmbientLight, SmoothLeftWave, etc. give error Invalid input, please check you used the correct format for the colors when trying to use in CLI on v0.10.1. Used to work on v0.9.0

How to create presets/ CLI issue

  1. I know this could be sound stupid but how do you create presets? I cant see it anywhere in this repo. Can anyone point it out for me if i was just being blind.
  2. the cli doesnt read ripple as a valid effect parameter

Lenovo Legion 7 Gen 6 AMD keyboard not recognized

Lenovo Legion 7 Gen 6 AMD
model 16ACHg6
part number 82N6007RUS
Windows 10 Home 20H2 (build 19042.1526)

Running the executable (or as admin) returns error "A valid keyboard model was not found. It may be due to a hardware error."

Fn+Q not working?!!!

H. After trying the software I closed it(completely, quit it from the taskbar) and when i when i pressed the buttons i was able to change the vantage defaults. But after a few hours, Fn+q isnt even working at all. I have to manually select it in vantage and only then does it work. Any help would be appreciated. Legion 5 AMD 2021. Please help.

"Ambient light" effect

Responds to content on the screen and adjusts KB colors

Rough idea of how to:

  • Take a 4x1 input "image" (or a native size which is then downscaled)
  • Process the color values into an array
  • Transition to them rather fast

Will probably need a limit on the updates per second

Needs a library, preferably cross compatible on both windows and linux.

Can only modify one out of four presets

When running linux and using this tool, I can only modify one preset, the other 3 remain as default: pulse, wave and fade. On windows, upon setting it with the proprietary Lenovo software, it loads them up upon booting.

Is this limitation caused by proprietary firmware level stuff, reverse engineering difficulties, or what?
Would definitely like to help on this matter as it is kinda annoying having some RGB on your face while I switch to my preset at 3 in the morning.

Ditch Pulse

Swipe replaces it pretty nicely. Much more complete.

Arch AUR Package

Are you planning to release an AUR package for easier installing/updating on Arch systems? Thanks!

Build process failing

Hi,

I tried to build the project as described in the README, but ran into an issue as screenshoted below. Not familiar with the Rust build process so it's entirely possible I've done this wrong. I'm on Manjaro with Kernal 5.16.7-1

image

Error: Couldn't find device

Hey there. I have a Lenovo Legion 5 (not Pro) and I've tried running the executable and get this error:

thread 'main' panicked at 'Error: Couldn't find device', src/main.rs:8:21 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

Respond to keyboard input

Pretty much what it says, find a way to detect keyboard input. Might be useful for things like turning on the lights when input is detected and turning them off after some time.

Legion 5 Pro after opening nothing

Hello

Legion 5 Pro: 16ACH6H 4 zone RGB keyboard
Windows 11.

I wanted to open the program but literally nothing happens. (even in compability mode)
Trying to open the latest version and 0.7.0 do the same thing.

I try to open it and maybe it instantly crashes but I see that nothing is happening.
It doesn't give any errors, just completely nothing.

Also installed Rust but it didn't help.

Swipe

The code logic of SmoothWave except the user chooses the colors via the zone rgb

AmbientLight effect sensitivity/speed adjustment parameter

Hi. Props to you for putting this program together, it works fine on my Legion 5 (15ARH05H).

It's working fine overall but, at times the program is reportedly using 8%+ CPU including while not much/anything is going on the screen.

So, to minimize the load on the CPU I think it's be nice to have a parameter to set the rate of the screen reading so that we can have it respond quick enough to our preferences while also saving some system resources. I know, these are beasty machines and all but for one I'd be fine with even half the detection rate/reaction time knowing that the program isn't doing that at times 8%+ processing anymore. :D

Question about Fn+Space handling

Hey,

I the author of https://github.com/BartoszCichecki/LenovoLegionToolkit and I am in progress of adding RGB support.

The problem I see is that I listen to WMI even LENOVO_GAMEZONE_LIGHT_PROFILE_CHANGE_EVENT to detect Fn+Space presses. However it seem like the keyboard still attempts to switch the internal profile, so there is a little bit of flickering.

Vantage somehow manages to disable the internal profiles and I cannot figure out how.

Did you encounter similar issue?

Fn+Space shortcut functionality

To be done in a similar order to:

  • Detect duplicate processes runing, things will get messy otherwise.
    • Needs testing on Windows
  • Needs a settings window (maybe not necessary for just this part).
  • Profiles may need more sections, most notably a name (regardless of filename / file location).
  • A settings file which should contain a section that can indefinitely scale for new effects (Vec<Profile> maybe?).
  • The saved data would be represented in the GUI by having a toggle to switch to "My Profiles" on the effect selection part with add and remove buttons (Will load from files).
  • Use meta+space (Win+Space) since fn cannot be reliably detected.
  • Fix annoying bug with the GUI not correctly updating.

Notes:

  • The editing of the profiles section will probably only be done via GUI
  • The CLI would need a "Profiles" mode

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.