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

BUGFIX: Icons not shown in KDE #9

Closed jsalatas closed 7 years ago

jsalatas commented 7 years ago

Seems that it fixes issue https://github.com/andrebrait/prime-indicator/issues/7

Tested in Plasma 5.8.2 Not sure if it works in other Desktop Environments (I guess it should) :\

jsalatas commented 7 years ago

If it doesn't work for other DE's, I guess you can do the same "trick" you did in logout function

env = os.environ.get("XDG_CURRENT_DESKTOP", "UNSUPPORTED")
if env.startswith("kde"):
   self.icon.set_icon(os.path.abspath(self.icon_path + "/" + self.icon_name))
else:
   self.icon.set_icon(self.icon_name)

:wink:

andrebrait commented 7 years ago

I thought of doing this, but the real issue is that setting the absolute path for the icon would make the current behaviour for the theme-default (which is to fall back to the full color icons if no icon for Intel and NVIDIA are provided by the current icon theme) not work, making it behave like the color option all the time. This is why I had been using the icon theme folder and the generic names intel and nvidia for the icons when the theme-default option was selected.

I'll boot into my installation of Kubuntu where I also have Unity and test it there. Give me a few minutes :)

andrebrait commented 7 years ago

I found a solution! I don't know exactly why, but the GTK icon lookup got completely broken in KDE 5.8 when adding an extra folder for the lookup. I did it manually in my application. Let's hope it doesn't interfere with other DEs. KDE and Unity seem fine, but I'll have to test with XFCE, etc., as well. Committing soon.

andrebrait commented 7 years ago

Since this was fixed in commit a5ff3c5f34bbbccf225e41e8bd29384559d862fb I'm closing this pull request. Thanks a lot for contributing! Your solution served as base for the one I ended implementing!