tuxedocomputers / tuxedo-control-center

A tool to help you control performance, energy, fan and comfort settings on TUXEDO laptops.
GNU General Public License v3.0
486 stars 63 forks source link

No "Profiles" in the autostarted tray since 2.1.6 (KDE Plasma) #363

Closed cyanescent closed 2 months ago

cyanescent commented 4 months ago

The "Profiles" menu in the autostarted tcc applet/tray has disappeared since the update to version 2.1.6. I am using KDE Plasma (X11, arch). I get "Profiles" back in the tray when I quit and reopen it, but it would be nice to have it again right from startup!

whowantsmybigdata commented 4 months ago

same issue for me. Version 2.1.7 as well. X11, kubuntu 22.04

othbert commented 4 months ago

same with 2.1.7 on latest tuxedo os

cyanescent commented 3 months ago

The issue is gone! I did the update to Plasma 6 today (I think it wasn't gone right away), and played a lot with the parameters.

Please try the following, that may be related:

I wish we could pass commands like this ones (with -p for profile)

tuxedo-control-center -p "Cool and breezy"

or similar.

cyanescent commented 3 months ago

The issue is still here in the Wayland session :-/ (KDE Plasma 6) The above things to try are not sufficient to solve the bug.

cyanescent commented 3 months ago

I have found a fix in the meantime:

  1. Unselect Tray autostart and quit.
  2. Go to Plasma's settings --> Autostarted apps --> add application --> Command tuxedo-control-center --tray selecting run in Terminal.
crissi-tuxedo commented 3 months ago

The issue is gone! I did the update to Plasma 6 today (I think it wasn't gone right away), and played a lot with the parameters.

Please try the following, that may be related:

* Remove and add back tcc from autostarted apps.

* Close it and start it from the terminal with `tuxedo-control-center`.

I wish we could pass commands like this ones (with -p for profile)

tuxedo-control-center -p "Cool and breezy"

or similar.

You can switch profiles through dbus, like I described in Issue #318

We will look into the problem with Plasma 6, keep in mind that there are still a few bugs to iron out with Plasma 6 hence us not having switched to it yet

best regards, Crissi

cyanescent commented 3 months ago

A sum up about the bug, it was introduced with the update 2.1.6 prior to the update to Plasma 6. I cannot test anymore in Plasma 5, but it is possible that the bug goes away upon reinstallation of tcc. It made it disappear in the X11 session, however it persists in Plasma 6's Wayland session. It seems to be related to the way the "Tray autostart" option works, as Plasma can autostart it correctly from the terminal command tuxedo-control-center --tray.

Thank you for the insight about the existence of the --new-profiles option, although it is not sufficient for my skills to get the right switch command (an example would be useful, especially about the "path to profiles").

If you are going to work on Plasma integration, perhaps it is a good idea to link the tcc profiles switch with the built-in (but deactivated) Plasma profiles switch (available through the battery/energy setting and the shortcut SUPER+B).

crissi-tuxedo commented 3 months ago

Small update: I am trying to recreate and I only managed to have the profiles not show up temporarily.

They come back a few seconds later.

I also asked my coworkers and they sporadically see this behavior too.

My guess would be, that it's some kind of race condition...

you guys using auto-login by any chance?

My theory is that the Tray tries to get information from tccd, but tccd has not yet loaded, hence the missing options in the tray.

I don't think it's actually connected to wayland or Plasma 6 at all, just to general loading time. But it's hard to say without reproducing the bug.

I have also not seen any relevant changes to the tray functionality between 2.1.5 and now. Maybe tccd just needs a second more to load with the new features now and hence triggers the bug on some machines.

Looking at the code it seems to at least be plausible.

cyanescent commented 3 months ago

Yes, I confirm I am using auto-login, and that I have observed a slight randomness of the outcome when testing. That's plausible.

crissi-tuxedo commented 3 months ago

Good news: I was able to reproduce the bug and will now investigate further

whowantsmybigdata commented 3 months ago

I have found a fix in the meantime:

  1. Unselect Tray autostart and quit.
  2. Go to Plasma's settings --> Autostarted apps --> add application --> Command tuxedo-control-center --tray selecting run in Terminal.

Does work for me as well, but I put the command in a bash-script and added a sleep, because otherwise it wasn't working.

#!/bin/bash

sleep 5 && /opt/tuxedo-control-center/tuxedo-control-center --tray

Can confirm, the bug is still there on Plasma 5 for me but as mentioned before, with "Tray autostart" active its mostly failing to show the complete menu when clicking on the tray icon after rebooting but sometimes it works...

crissi-tuxedo commented 3 months ago

Does work for me as well, but I put the command in a bash-script and added a sleep, because otherwise it wasn't working.

That makes sense, as the issue is, that the dbus initialization in main.ts fails (which also handles the tray) because tccd takes too long to set dbus up.

Don't worry, you won't have to live with the workaround for too long, we are working on a small fix, that should be rolled out with the next minor release :)

best regards, Crissi

whowantsmybigdata commented 3 months ago

thanks a lot for fixing it!

crissi-tuxedo commented 3 months ago

The new version is out :)

hopefully that resolves your problems, if not let me know :)

cyanescent commented 2 months ago

Yes, it now works as intended. Thank you!