This might seem like a silly idea to you, but I think it makes a lot of sense, let me explain.
Currently, users can assign a custom icon to any file using gio with a simple gio set -t string myfile.txt metadata::custom-icon file:///path/to/icon.svg. The downside to this is that, at the system level, it is difficult for a programmer to set up custom icons for, say, a custom pseudo-file system that uses FUSE. However, there is something that can be done.
My suggestion is that, just as Nautilus (or gvfs, I’m not actually sure which one it depends on) can read the gio custom icon property, it should also be able to read it from xattr (for example, from user.custom-icon or user.metadata.custom-icon). This way, a programmer could set the icon simply by setting that extended attribute.
I find this particularly useful for what I was telling you about FUSE earlier. As a programmer, I can design the file system representation to include those extended attributes, so that when the user mounts my FUSE pseudo-system, the corresponding icons will appear.
What do you think?