nls1729 / acme-code

Gnome Shell Extensions etc...
https://nls1729.github.io
GNU General Public License v2.0
66 stars 25 forks source link

For better theme integrations, switch to using builtin notifications icons #39

Closed goodwillcoding closed 6 years ago

goodwillcoding commented 6 years ago

This PR change the icons to notifications-symbolic and notifications-disabled…-symbolic so it fits better with various themes. I am hoping this makes sense to you :-D

nls1729 commented 6 years ago

Your pull request would be a good idea but there is no standard followed by all linux distros for "builtin notifications icons". Simply stated you cannot expect to find "notifications-disabled-symbolic" and "notifications-symbolic" as named icons on all linux systems using the gnome shell. The only named icons you can use by name for an extension are those used by the gnome shell. And using the named icons of the gnome shell is not dependable because a new release may not use the named icon.

I will leave your pull request open for a few days in case you have any questions.

goodwillcoding commented 6 years ago

Would you be open to a preference checkbox for this then? Something like check box of "use system icon"? I'll update the PR with the relevant code :-D

nls1729 commented 6 years ago

There is no way to insure an icon named a particular way is available when each linux distro can choose the icons it provides and how they are named. Using a named icon from the distro you are using does not change the situation. It only creates the problem of an option that would not work in all cases. Code could handle determining if the option should be presented. ...which leads to providing documentation which must explain why some users may not be able to have the option.

goodwillcoding commented 6 years ago

So to add a little more information, I checked about a dozen icon themes (Adwaita, DMZ-Black, DMZ-White, HighContrast, Humanity, Humanity-Dark, LoginIcons,Macos-sierra-CT,Papirus, Papirus-Adapta, Papirus-Adapta-Nokto, Papirus-Dark, Papirus-Light,default, ePapirus, gnome, hicolor , la-capitaine-icon-theme, macOS-iCons, ubuntu-mono-dark ,ubuntu-mono-light).

You were right that most of them do not have notifications- and even notification- icons. Surprizingly the external ones do (Numix, la-capitaine-icon-theme, macOS-iCons) and the more built in ones do not. I happen to have several of those themes so I thought it was uniform

I also looked up whether it is possible to look up if icon translates to a file and Glib/Gtk..lookup_by_gicon method allows one to do it. See examples below (vala and python but it's the same API). https://github.com/porridge/autorenamer/blob/master/autorenamer/thumbnails.py#L97 https://stackoverflow.com/a/34033727

From what can tell it's a it's not compicated call (few lines of code will do) where we find if it exists. So if you are up for "use system icon if available of the fallback modification", I'll update the PR along with a preference for it,