Score:1

gio: Setting attribute metadata::custom-icon not supported

cd flag

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.

David avatar
cn flag
Seems what ever it is your are trying to is simply not supported. Have you looked at this question? https://askubuntu.com/questions/1044358/is-it-possible-to-insert-icons-on-folders-with-the-gio-set-command
Score:1
mx flag

I've encountered you problem, got the same error. At last I found there were different "gio" in my Ubuntu. The one that report metadata::custom-icon not supported was /home/user/anaconda3/bin/gio, which was provided by annaconda3.

And there was another /usr/bin/gio provided by apt-get, which worked for me.

To discover which one of "gio" you are using, just type which gio in bash to find out. To fix the problem:

Change $PATH to use system provided gio, or use absolute path of /usr/bin/gio. Hope that works for you.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.