On Ubuntu 22.4 lts I can manually assign an icon to an executable file in nautilus, by right clicking on that file in the file explorer, select "Properties", click on the default icon, and select a new icon file.
After I've done that gio info <filename>
gives me metadata::custom-icon: file:///my-icon.png
So far so good.
But when I try to set the icon via gio like this
gio set -t 'string' "${FILE_PATH}" metadata::custom-icon "file://${ICON_PATH}"
I get an error
gio: Setting attribute metadata::custom-icon not supported
metadata:custom-icon should be writeable by gio, as
gio info -w <filename>
shows me
Writable attribute namespaces: metadata (string, Copy with file, Keep with file when moved)
I want to use this as part of a postinst script for my deb package. Other metadata values also won't work, like metadata::trust etc.
I know, this Question has been asked before, but I haven't found a solution for this problem yet.