Score:0

Ubuntu 20.04 : How to set a custom icon via command line / gio set metadata::custom-icon not writable

ru flag

I am trying to assign custom icons via the bash shell using "gio set" in the following manner: "gio set -t string $FOLDERPATH metadata::custom-icon file://$FILEPATH" where $FOLDERPATH is the folder, and $FILEPATH is the image to be assigned, and receive the following error: gio: Setting attribute metadata::custom-icon not supported

"gio info --query-writable $FOLDERPATH" does not show metadata::custom-icon as writable, but it appears that this used to be possible using "gio set" or "gvfs-set-attribute". Is there any method to set a custom icon via command line or has this been fully deprecated?

EDIT: Here's an example of the command I am trying without variables: "gio set -t string /home/dud/test metadata::custom-icon file:///home/dud/test/test.jpg". Has anyone tested this or set custom icons via command line in Ubuntu 20.04?

vanadium avatar
cn flag
Chem the man page. It may be that the option -t must come after specifiying LOCATION, ATTRIBUTE and VALUE. Anyway, you could simply remove `-t string` in this case because it is the default
user9453304 avatar
ru flag
Thanks @vanadium, but that's not pertinent. Omitting or changing the placement of '-t string' makes no difference. As I stated, it seems it used to be possible to set custom icons, but 'gio' and 'gvfs-set-attribute' no longer seem to have that functionality. Do you have any info on helping to set custom icons?
N0rbert avatar
zw flag
Check possible syntax at https://askubuntu.com/a/1320321/66509 .
vanadium avatar
cn flag
Syntax looks good, but obviously we do not know about the variables. They are not quoted, so there could be an issue.
user9453304 avatar
ru flag
Edited question with specific variables. Here's hoping someone actually addresses the question.
Gao Pinker avatar
mx flag
I've encountered the same problem, maybe you can try this https://stackoverflow.com/questions/68874201/gio-command-wont-display-metadatacustom-icon-attribute/76742254#76742254
Score:0
us flag

I don't know if you already fix the problem but for the people of the future:

Are you writing correctly the command? It is very tricky to make it works, I had a lot of problems because the path of picture has a space and because of the slashes '/'.

The command should be like this example: gio set $HOME/Documents/C metadata::custom-icon file://$HOME/Pictures/App_Logos/C.png

DO NOT USE SPACES! Using \ don't works,

I have created a bash script to change icons in bulk, check it here

Score:0
mx flag

I've encountered this problem too, Maybe it was coursed by a wrong version of gio, you can try this here https://stackoverflow.com/questions/68874201/gio-command-wont-display-metadatacustom-icon-attribute/76742254#76742254

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.