I have files with the “metadata::custom-icon” custom attribute, and I need to detect when that attribute changes. I tried using a file monitor both in the file itself and in the folder that contains the file, but I don’t receive notifications in that case. I know that nautilus detects it, but I’ve been checking the code without luck.
How can I detect it?
EDIT: I found that there is a DBus interface, org.gtk.vfs.Metadata, but there is no signal for specify that something changed.
EDIT2: I found that the metadata is stored at ~/.local/share/gvfs-metadata, in, at least, two files: home, and home-XXXXXX.log. The later one seems to be updated every time a change is made to a metadata key-value, and the former seems to be updated with a lot of delay. I found some info at https://gitlab.gnome.org/GNOME/gvfs/-/blob/master/metadata/file-format.txt, but there doesn’t explain how to know which of all those files contain the journal (in my system I have several .log files, but all but one are quite old…).
EDIT4: I forgot to comment that Nautilus does all the notification internally. When it changes the property, it notifies with a GLib signal, to which, of course, an external process can’t connect.