andrebrait / prime-indicator

PRIME Indicator Plus - enhanced indicator applet for NVIDIA Optimus laptops
GNU General Public License v3.0
69 stars 12 forks source link

Duplication of Indicator with quick-switch (KDE) #2

Closed poVoq closed 8 years ago

poVoq commented 8 years ago

Reference to this: https://github.com/beidl/prime-indicator/issues/19

Issue still happens after latest try to fix it. No idea why, but I am willing to test new releases on my Kubuntu 16.04 laptop.

andrebrait commented 8 years ago

This will be resolved on the next release, which will happen in a couple of days. Thanks for reporting and testing! I'll report the progress as soon as it happens

andrebrait commented 8 years ago

@poVoq please try with this version if you can

poVoq commented 8 years ago

Hmm, no change, but I am not sure if I cleanly uninstalled it. What I did was run (as root) the "uninstall.sh" that I still had from the installation folder where I extracted the files to. Then I downloaded the new version and installed it. At no point it showed any errors, but the indicator did not disappear after uninstalling. After a reboot I tested it, but the indicator is still duplicated and everything looks exactly the same. So maybe I am still on the old version without knowing?

What I noticed is that in the new version the autostart question is slightly unintuitive as you have to enter a number, and not a (Y/n) with "enter" giving you the default option. At first I thought a "Yes" or a "Y" would do the trick.

andrebrait commented 8 years ago

Ok. I'll look further into it.

As for a clean uninstall, it can be achieved by doing:

sudo rm -rf /usr/lib/primeindicator sudo rm -rf /usr/lib/prime-indicator sudo rm -rf $HOME/.config/primeindicator sudo rm -rf $HOME/.config/prime-indicator sudo rm -f /usr/bin/primeindicator.py sudo rm -f /usr/bin/prime-indicator sudo rm -f /usr/bin/primeindicator sudo rm -f $HOME/.config/autostart/primeindicator.desktop sudo rm -f $HOME/.config/autostart/prime-indicator.desktop

This should cover the previous version as well. After uninstalling it, log ou and then back in as the process is not insterrupted when it's uninstalled. Only recently I made it in a way I could even distinguish between it and another python script.

About the installer, yeah. I agree. However, bash does not work very well when using the standard user input stuff due to buffers, etc. So, instead of spending the whole day trying to make it properly and reliably clear the input buffer after prompting for user interaction again, I just switched to a select.

I'll start working on the final solution for KDE now.

andrebrait commented 8 years ago

I just comitted a change that should restrict it to a maximum of one instance running. When it starts, it terminates any older instance before starting itself.

poVoq commented 8 years ago

Did a purging of the files as you suggested then tried to install the latest version, but it doesn't work anymore (no icon or functionality at all on a reboot).

If I try to start is manually as suggested by the installer I get the following error:

(prime-indicator:5846): Gdk-CRITICAL **: gdk_window_thaw_toplevel_updates: assertion 'window->update_and_descendants_freeze_count > 0' failed

And then I see a non-functional black& green nvidia icon (but I didn't change the config file) and next to it a blank space..

andrebrait commented 8 years ago

Wow! Please give me more details of your setup. Which distro/version are you running?

poVoq commented 8 years ago

I am running recently installed Kubuntu 16.04 with a Nvidia 970m (drivers 370.28). Quite a common setup I believe.

andrebrait commented 8 years ago

Indeed. Sorry for taking so long to look into it. What is the content of your config file? Open the terminal and run cat $HOME/.config/prime-indicator/prime-indicator.cfg and post the result here.

poVoq commented 8 years ago

[PowerManagement] enabled = true

[Appearance] iconset = theme-default

andrebrait commented 8 years ago

Try changing the iconset to color and starting it again

poVoq commented 8 years ago

Hmm, no real change. But I noticed a few odd things: When I tried to change it the first time, the .config/prime-indicator folder and the .cfg were under the "root" owner and group. But changing that to the actual user and making the above suggested change did not result in the app starting upon a reboot.

I then uninstalled everything another time and reinstalled it from the current github state and rebooted, but interestingly the .config/prime-indicator folder and the .cfg never get created. I guess the reasons why there were root in the beginning was that when I tried to start the program manually I must have used sudo for it.

As a last try I created the above folder and .cfg manually to see if it works then, but again no luck.

andrebrait commented 8 years ago

That's extremely odd. Creating the configuration files is literally the first thing it does.

Run the uninstall.sh as root (sudo ./uninstall.sh). Next, run the installer as root (sudo ./setup.sh). When it asks if you want to make it autostart, answer 1 (Yes).

Next, start it as your common user without sudo, by running /usr/lib/prime-indicator/prime-indicator and post any output that's presented in the terminal.

I'm sorry for not being able to test it myself, but I'm currently on Manjaro for "packages I need not being up to date on Ubuntu" and I've yet to find some time to install Kubuntu to a flash drive and test it.

poVoq commented 8 years ago

Ok thanks for the help in troubleshooting!

I did as instructed above, but when I try to start is as a common user it just complaints that I do not have the rights to run it (this is a German system so direct cut&paste of the output would help you little).

andrebrait commented 8 years ago

Hm... Maybe I messed up the permissions a little bit. Try doing sudo chmod +x /usr/lib/prime-indicator/primr-indicator first and then try again.

andrebrait commented 8 years ago

Oh wait. I think I know what I did wrong. I'll modfiy the setup script and I'll report when I'm done

andrebrait commented 8 years ago

@Well, it should be corrected now. I had assigned the wrong icon name for the nvidia icon with the color option...

I also have a new branch with custom icon coloring implemented, if you'd like to try it =)

EDIT: Ok, found the problem! I'll be updating the script ASAP.

andrebrait commented 8 years ago

Ok, I fixed this. I'll report when I merge the fixes to master.

poVoq commented 8 years ago

Sound great. let me know if there is something I could test.

andrebrait commented 8 years ago

Will do in a few minutes =)

I'm finishing testing it under Unity, etc.

andrebrait commented 8 years ago

Done! Looks like it's ok!

Please report back if the issue was solved!

poVoq commented 8 years ago

First try it didn't work, but after a clean manual de-installation as explained above, it now seems to work perfect! Thanks a lot for fixing it on KDE :+1:

andrebrait commented 8 years ago

You're welcome!