[gio] "metadata::custom-icon" file attribute not seen by shell extension code

assigning a custom icon to a directory (for instance in nautilus) will set the metadata::custom-icon file attribute. this can be confirmed by running the following code as standalone script (with the gjs command):

const Gio = imports.gi.Gio;
const f = Gio.file_new_for_path('/dir/with/custom/icon');
const fileInfo = f.query_info('*', 0, null);
const attrib = 'metadata::custom-icon';
log(attrib + ': ' + fileInfo.get_attribute_as_string(attrib));

however, running the same code as part of a gnome shell extensions, it returns null.
why is that?

no one? :sob:
is this the right place or should I be asking this question somewhere else?

I suppose this is because https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2284. It should be possible to use sudo setcap -r /usr/bin/gnome-shell as a workaround…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.