I would like to add emblems to a file in Thunar using a script, but I can't find any documentation on this.
Is it possible to do this? And if so, how?
The same question was asked here, but they mention a ~/.cache/Thunar/metafile.tdb
file which does not exist on my system. I think that question and the answer are outdated.
Thunar, since version 1.6, has started using the gvfs-metadata daemon to store metadata. The metadata is stored in
~/.local/share/gvfs-metadata
, however you can't read it from the files (it's stored in some binary format I think). In order to read metadata you use thegvfs-info
command like this:Which will print out the metadata of
/some/location
.If you want to change metadata you can use the
gvfs-set-attribute
command like this:/some/location
is the location of the file/folder whose metadata you want to edit,-t stringv
tells the command to expect string input,mdtype
sets the type of metadata you want to change (e.g.emblems
) andnew value
setsvalue
as the metadata formdtype
. For example:Gives the
Downloads
folder thedefault
emblem.Set the value to
none
to remove emblems. You will have to restart the file manager to see the changes.I wrote a small script that allows you to change the emblem of more than one folder/file at a time:
Sources:
The Nautilus mailing list
Thunar FAQ
How to change icon/emblem of a directory from bash