4JX / L5P-Keyboard-RGB

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.
GNU General Public License v3.0
302 stars 40 forks source link

Profiles not saving. #163

Open mcoyle1960 opened 1 month ago

mcoyle1960 commented 1 month ago

First off, works great on Legion Pro 5 16IRX9, except...

Profiles not saving.

Running app with sudo ./legion-kb-rgb and while it works, I get this in the terminal:

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: D-Bus error: /usr/bin/dbus-launch terminated abnormally without any error message (org.freedesktop.DBus.Error.Spawn.ExecFailed) Location: /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ksni-0.1.3/src/service.rs:83

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it. Run with RUST_BACKTRACE=full to include source snippets.

Thanks for your work!

4JX commented 1 month ago

If I understood this correctly, it's two separate issues?

Profiles not saving.

When you go to save a profile (externally) does it crash/lock up/do nothing? Or do you mean the settings file keeping track of the in-app profiles?

and while it works, I get this in the terminal

knsi is related to the tray icon, which has been bugging me forever in linux.

Does everything else still "just work" or does the whole app crash? What desktop/window manager are you using?

PS: Have you tried https://github.com/4JX/L5P-Keyboard-RGB?tab=readme-ov-file#usage to not have to use sudo?

mcoyle1960 commented 1 month ago

I was making a detailed list of my actions when I discovered whats causing the problem. I have been closing the window by clicking the 'close window' title bar button. Not good.

When I quit the app using the 'Exit' menu option, everything works as intended. Profiles are saved and it cleanly exits the terminal.

So the issue is quiting the app via the title bar button.

Additionally, I tried adding the 2023 Legion code to /etc/udev/rules.d/99-kblight.rules (which I created), but I can't run as user. This is not problem for me at all, but thought you'd like to know. BTW, my computer is a 9th gen 2024 Legion Pro 5. More info below.

OS: Fedora release 40 (Forty) x86_64 Host: 83DF Legion Pro 5 16IRX9 Kernel: 6.9.7-200.fc40.x86_64 Resolution: 2560x1600 DE: GNOME 46.3.1 (wayland) WM: Mutter CPU: Intel i7-14650HX (24) @ 2.2GHz [47.0°on] GPU: NVIDIA GeForce RTX 4060 Max-Q / Mobile GPU: Intel Raptor Lake-S UHD Graphics Memory: 7.05 GiB / 31.06 GiB (22%)

Thanks for your quick response.

4JX commented 1 month ago

So the issue is quiting the app via the title bar button. DE: GNOME 46.3.1 (wayland)

Ah yeah, this pretty much comes down to the app trying to create a tray icon where there's no possibility to. The usual behaviour (in the case that there's a system tray) is that the window close button really "only" closes the window, and lets a tray icon be displayed to control the app while it runs in the background.

In this case it's trying to create a tray icon, and failing, but not overriding the close behaviour

The application panicked (crashed). Message: called Result::unwrap() on an Err value: D-Bus error: /usr/bin/dbus-launch terminated abnormally without any error message (org.freedesktop.DBus.Error.Spawn.ExecFailed) Location: /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ksni-0.1.3/src/service.rs:83

The exit button on the other hand always quits the app unconditionally.

9th gen 2024 Legion Pro 5

Ah whoops, forgot to add those models to the readme. Try using these IDs.

mcoyle1960 commented 1 month ago

Sorry, not sure I did this correctly based on the link you gave me above, but these are the lines I placed in: /etc/udev/rules.d/99-kblight.rules

SUBSYSTEM=="usb", ATTR{idVendor}=="048d", ATTR{idProduct}=="c995", MODE="0666" SUBSYSTEM=="usb", ATTR{idVendor}=="048d", ATTR{idProduct}=="c994", MODE="0666"

and then: sudo udevadm control --reload-rules && sudo udevadm trigger

Not able to run as user with version 0.19.6.

Just to be clear, I don't care about running as user. :) But if it helps you, I can keep trying things.