Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Profiles not saving. #163

Closed
mcoyle1960 opened this issue Jul 9, 2024 · 9 comments
Closed

Profiles not saving. #163

mcoyle1960 opened this issue Jul 9, 2024 · 9 comments

Comments

@mcoyle1960
Copy link

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
Copy link
Owner

4JX commented Jul 9, 2024

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
Copy link
Author

mcoyle1960 commented Jul 10, 2024

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
Copy link
Owner

4JX commented Jul 12, 2024

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
Copy link
Author

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.

@4JX
Copy link
Owner

4JX commented Sep 19, 2024

Hello, can you test if it works with https://github.com/4JX/L5P-Keyboard-RGB/actions/runs/10948820367 and "AppIndicator and KStatusNotifier..." as the tray icon extension? Seems to do the trick over here with no crashes

image

@mcoyle1960
Copy link
Author

mcoyle1960 commented Sep 19, 2024

A little better. As sudo, I can close the app and it doesn't crash, but it doesn't fully quit either. As a normal user, the close box doesn't seem to work. Here's a short video showing what's happening.

OPPS: forgot to comment on the topbar icon. Yes it works.

legion-kb-rgb.mp4

@4JX
Copy link
Owner

4JX commented Sep 21, 2024

I was hoping that the window not hiding was just an issue with my "fancy" NixOS system but it looks like its general to any system running wayland (for the GUI framework I'm using).

Will hit them up about it and see if something can be done, because otherwise I'd be stuck on a year old version of it.

@mcoyle1960
Copy link
Author

Don't worry too much about it. Your app is great. It's what tipped me into buying the Lenovo knowing that I could control the keyboard lights in Linux. Keep up the great work.

@4JX
Copy link
Owner

4JX commented Jan 2, 2025

Tray should be working with https://github.com/4JX/L5P-Keyboard-RGB/releases/tag/v0.20.0. Decided to not tackle window hiding for now.

Tracking #181

@4JX 4JX closed this as completed Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants