ubuntu / gnome-shell-extension-appindicator

Adds KStatusNotifierItem support to the Shell
https://extensions.gnome.org/extension/615/appindicator-support/
GNU General Public License v2.0
1.2k stars 164 forks source link

Per app fixes to pixmap indicators #213

Open Rickycezar opened 4 years ago

Rickycezar commented 4 years ago

Would it be accepted if I created some per app fixes to try to get valid icon theme images? For indicators that don't provide name, or other useful info, only pixmaps, it would be easier to get a nice look following the icon theme of the user.

I made it on my own instalation to fix the icon for an app I use: Synergy. The app does not provide much to create the indicator icon besides a pixmap of the current icon to be displayed, which is part of the app data. I wanted it to look nice, so I made a condition based on the indicator ID, if it is Synergy, i'll analyze the pixmap data to figure out what icon should be displayed and pass the correct data to _cacheOrCreateIconByName, so the theme icon will be displayed.

I could make the whole process more organized and submit fixes for known apps. Would it be an acceptable PR or is it too janky of a solution?

3v1n0 commented 4 years ago

Yeah, it could be nice to have...

We should define a "standardized" protocol, but it could be acceptable indeed.

Rickycezar commented 4 years ago

I'll try and work on it when I get some free time.

andia89 commented 4 years ago

@Rickycezar @3v1n0

I played around with that, and came up with a solution that might be acceptable https://github.com/andia89/gnome-shell-extension-appindicator/tree/pul

All you need to do is create a file called replace.keyfile in ~/.local/share/indicators/application/ (or the corresponding /etc path for systemwide) and put

this._indicator.id, <icon name in the GTK theme>

and it will use the icon from the theme. Doesn't matter if the indicator is GTK, Qt of anything else. Do you think that is a good solution? Do you think there is a better way to implement that?