How can I create a new kind of emblem?

Solution 1:

From Nautilus, go to the Edit menu, select Backgrounds and Emblems, click on Emblems, and then on the Add a New Emblem button at the bottom of the dialog.

Solution 2:

You can also set a custom emblem on a file from a script by running this command:

gvfs-set-attribute -t string <filename> metadata::custom-icon file:///home/user/path/to/icon.png

Solution 3:

The previous answer really create a custom icon for the object, which is not exactly the same thing an emblem is.

The first answer unfortunately does not work anymore for gnome3. I found that, to create an emblem named for example "mymusic", you can add a png 48x48 image called emblem-mymusic.pngin the directory:

~/.icons/hicolor/48x48/emblems

and in the same directory you create a text file, called emblem-mymusic.icon with the content:

[Icon Data]
DisplayName=mymusic

That's it. Now you can set/unset them following the answer to Is there any tweak to bring back emblems in Nautilus?