Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-02-18 00:53:08

golinux
Member
Registered: 2011-11-19
Posts: 127

[Solved] Custom icon theme not working as expected

I have colorized folders of the gnome-icon-theme to match the darkpurpy theme previously discussed on this forum.  After looking at quite a few index.theme setups this is what I put together:

[Icon Theme]
Name=DarkPurpy
Comment=Colorized Gnome Icons
Inherits=gnome,hicolor
Example= folder

Directories=16x16/actions,16x16/places,16x16/status,22x22/actions,22x22/places,22x22/status,24x24/actions,24x24/places,24x24/status,32x32/actions,32x32/places,32x32/status,48x48/actions,48x48/places,48x48/status,256x256/actions,256x256/places,256x256/status

[16x16/actions]
Context=Actions
Size=16
Type=Fixed

[16x16/places]
Context=Places
Size=16
Type=Fixed

[16x16/status]
Context=Status
Size=16
Type=Fixed

[22x22/actions]
Context=Actions
Size=22
Type=Fixed

[22x22/places]
Context=Places
Size=22
Type=Fixed

[22x22/status]
Context=Status
Size=22
Type=Fixed

[24x24/actions]
Context=Actions
Size=24
Type=Fixed

[24x24/places]
Context=Places
Size=24
Type=Fixed

[24x24/status]
Context=Status
Size=24
Type=Fixed

[32x32/actions]
Context=Actions
Size=32
Type=Fixed

[32x32/places]
Context=Places
Size=32
Type=Fixed

[32x32/status]
Context=Status
Size=32
Type=Fixed

[48x48/actions]
Context=Actions
Size=48
Type=Fixed

[48x48/places]
Context=places
Size=48
Type=Fixed

[48x48/status]
Context=Status
Size=48
Type=Fixed

[256x256/actions]
Context=Actions
Size=256
MinSize=56
MaxSize=512
Type=Scalable

[256x256/places]
Context=Places
Size=256
MinSize=56
MaxSize=512
Type=Scalable

[256x256/status]
Context=Status
Size=256
MinSize=56
MaxSize=512
Type=Scalable

I assumed (it seems wrongly) that the recolored icons would replace those in gnome.  Some of the icons are but many of them are not.  Yes, I ran gtk-update-icon-cache on that directory but the icons are still mixed.  The only way I can get it to work is to copy the gnome theme, rename it and replace all the recolored icons which seems terribly inefficient - 13mb in all!

It's here if you want to play with it.

What am I missing?

If I can get this working, I would appreciate some advice on the proper protocol to package it for inclusion as the default icon theme for devuan.

Thanks.

Last edited by golinux (2018-02-20 02:03:36)

Offline

#2 2018-02-18 15:33:24

sixsixfive
Member
From: behind you
Registered: 2012-04-08
Posts: 579
Website

Re: [Solved] Custom icon theme not working as expected

it seams to work with adwaita: https://imgur.com/2bmkB9C

also your inherited icon theme needs to have the same folder structure as you icon theme, sorry but i cant really test it with the gnome theme because that one is abandoned and unmaintained since years

Offline

#3 2018-02-18 16:16:45

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: [Solved] Custom icon theme not working as expected

Thanks for the tip.  I'll experiment with that. Is there a way to clear the icon cache?  Maybe just deleting that file and rebuilding?  I'm thinking that there may be confusion because I have tried a number of different iterations trying to get it right.

Offline

#4 2018-02-18 18:31:30

alcornoqui
Member
Registered: 2014-07-28
Posts: 831

Re: [Solved] Custom icon theme not working as expected

> Is there a way to clear the icon cache?

Take a look at this: https://developer.gnome.org/gtk2/2.24/g … cache.html

Offline

#5 2018-02-18 20:14:32

sixsixfive
Member
From: behind you
Registered: 2012-04-08
Posts: 579
Website

Re: [Solved] Custom icon theme not working as expected

golinux wrote:

Thanks for the tip.  I'll experiment with that. Is there a way to clear the icon cache?.

pkill Thunar && rm -rf ~/.thumbnails ~/.cache/thumbnails

should work

Offline

#6 2018-02-18 21:29:51

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: [Solved] Custom icon theme not working as expected

alcornoqui wrote:

> Is there a way to clear the icon cache?

Take a look at this: https://developer.gnome.org/gtk2/2.24/g … cache.html

Thanks and apologies.  I should have thought to search that myself.  Maybe the --force option will do the trick.

It's still not working properly on jessie.  Thunar grabs all the places icons except for the plain folder.  Same thing happens when I point the theme to adwaita instead of gnome.

I need fire up the ascii (stretch) VM in a bit to see what it does there.  Last time I checked it was failing completely.

This behavior is really annoying.  It needs to be reliable if it is to be the default.

I should probably add the KDE compatibility lines also.

Offline

#7 2018-02-18 21:41:03

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: [Solved] Custom icon theme not working as expected

sixsixfive wrote:
golinux wrote:

Thanks for the tip.  I'll experiment with that. Is there a way to clear the icon cache?.

pkill Thunar && rm -rf ~/.thumbnails ~/.cache/thumbnails

should work

I was so hopeful that would do it but no joy.  AFAICS other applications are getting it right. Just not thunar.  What am I missing?

Offline

#8 2018-02-19 05:58:28

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: [Solved] Custom icon theme not working as expected

Here are some screenies of the problem on ASCII.  Three different users have confirmed that Thunar does this.

https://transfer.sh/coayY/icon_view.png
https://transfer.sh/GFRTj/list_view.png

I have posted to the Thunar mail list.  Will be interesting to see what they say . . .

Offline

#9 2018-02-19 15:51:17

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: [Solved] Custom icon theme not working as expected

Got an answer!  Haven't tried it yet.  Will report when I do.

Thunar, in contrast to many other file managers, is using the "inode-directory" icon for plain folders - which the theme you linked to is missing.

You can simply execute this in every of the "places/" subdirectory of the theme to create the necessary links:

    ln -s folder.png inode-directory.png

If the theme is not picking it up, you can refresh the cache via:

    gtk-update-icon-cache /path/to/DarkPurpy

(will need root permissions if system path obviously)

Best regards,

Markus

Offline

#10 2018-02-19 17:39:11

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: [Solved] Custom icon theme not working as expected

I am not quite understanding something.  The inode-directory.png file is already present in the gnome icon theme.   Why is it not being "inherited"?   Does that mean that the other links in gnome will also be broken ie "not inherited"?

Offline

#11 2018-02-19 19:19:20

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: [Solved] Custom icon theme not working as expected

What version of thunar are you using and what version of GTK?

From this commit: Use 'folder' icon instead of 'inode-directory':

Actually this is a workaround for icon themes such as Adwaita that have no 'inode-directory' icon. Previously on gtk2, gtk_icon_theme_has_icon returned FALSE for 'inode-directory' while using Adwaita, this is not the case for gtk3, probably because it falls back to Gnome icon theme, not really desired.

If you are using the GTK2 version, it sounds like GTK isn't properly inheriting that particular icon.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#12 2018-02-19 22:52:54

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: [Solved] Custom icon theme not working as expected

@ToZ . . . I'm starting to understand what's going on.  Thanks to each and everyone of you for your insights.  I added an inode-directory.png link to each of the DarkPurpy places folders and the problem disappeared on both Jessie and ASCII.  I did need to update the cache though.

Now a question about packaging . . .  This isn't really a fork it is an overlay on the gnome theme.  So does it require importing the source with the full history or can it be packaged as an independent project?

And finally, here's the answer to your version question.  Anything important there?

ToZ wrote:

What version of thunar are you using and what version of GTK?

JESSIE
thunar  1.6.3-2
gtk2-engines 1:2.20.2-3
gtk2-engines-xfce 3.0.1-2
gtk3-engines-xfce  3.0.1-2

ASCII
thunar  1.6.11-1
gtk2-engines 1:2.20.2-3
gtk2-engines-xfce 3.2.0-2
gtk3-engines-xfce  3.2.0-2

ToZ wrote:

From this commit: Use 'folder' icon instead of 'inode-directory':

Actually this is a workaround for icon themes such as Adwaita that have no 'inode-directory' icon. Previously on gtk2, gtk_icon_theme_has_icon returned FALSE for 'inode-directory' while using Adwaita, this is not the case for gtk3, probably because it falls back to Gnome icon theme, not really desired.

If you are using the GTK2 version, it sounds like GTK isn't properly inheriting that particular icon.

Offline

#13 2018-02-19 23:26:31

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: [Solved] Custom icon theme not working as expected

golinux wrote:

Now a question about packaging . . .  This isn't really a fork it is an overlay on the gnome theme.  So does it require importing the source with the full history or can it be packaged as an independent project?

I'd say create a new package that is dependent on then Gnome Icon Theme (as it's required for your theme).

And finally, here's the answer to your version question.  Anything important there?

ToZ wrote:

What version of thunar are you using and what version of GTK?

JESSIE
thunar  1.6.3-2
gtk2-engines 1:2.20.2-3
gtk2-engines-xfce 3.0.1-2
gtk3-engines-xfce  3.0.1-2

ASCII
thunar  1.6.11-1
gtk2-engines 1:2.20.2-3
gtk2-engines-xfce 3.2.0-2
gtk3-engines-xfce  3.2.0-2

Just a confirmation that both of those versions are GTK2 versions of Thunar.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#14 2018-02-20 01:59:39

golinux
Member
Registered: 2011-11-19
Posts: 127

Re: [Solved] Custom icon theme not working as expected

I think this from the thunar-dev list is the final word on this issue.  May be of use to someone else visiting this forum.

The inheritance of the parent theme (gnome) does work as intended, it
does inherit the uncolored (brownish) variant from the gnome icon theme
for the "inode-directory" icon. This is what you described as "[...] the
generic folder/directory icon reverts to gnome." in your original mail.

True, the inherited "inode-directory" is actually a symbolic link as
well. However, the inherited symbolic link is not interpreted relative
to the icon theme it is inherited by (DarkPurpy) but instead always
relative to the path where the link actually resides (gnome). When GTK
interprets the icon theme, it does not copy missing icons from the
inherited themes but instead traverses the inheritance tree recursively
until the first occurrence of the missing icon. This means, icons - and
also symlinks - are always loaded from within the respective theme's
directory.

In your case, the "inode-directory" icon is missing in "DarkPurpy".
Thus, GTK is traversing through the inheritance list (and the resulting
directories) to find the first parent theme that provides such icon,
which is "gnome". The provided symbolic link called
"inode-directory.png" is now interpreted relative to the directory where
the "gnome" theme resides. Thus it points to the corresponding gnome
variant of "folder.png" and returns this as the icon image, which is the
brown one.

When you specify your own symbolic link in the "DarkPurpy" theme
instead, it is loaded from there instantly and no traversing through the
inheritance list is done.

I hope this answers your question.

Best regards,

Markus

Offline

Board footer

Powered by FluxBB