Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Actually, I'm talking about icons for Nautilus Scripts, and I have many of them. Although I prefer menus without icons, I cannot prevent icons from being displayed in Nautilus context menu items Open With and Scripts.

Particularly, having the same script icon displayed for all of them does not look good at all. So, if I cannot prevent them, at least I'd like them use icons better related with the function of each script.

It's easy to assign a custom icon for a single file through File Properties but I have a total of 82 Nautilus Scripts at the moment!

When you enter gvfs-info /path/to/file command in terminal, you can see a line like this: metadata::custom-icon: file:///usr/share/icons/NITRUX-Buttons/apps/scalable/accessories-text-editor.svg

I wonder if it is possible at all to edit this line (where ever it is) in a batch / from command line?

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I couldn't see it in the list shown as I was writing this question, but later I saw a similar question and the answer I was looking for in the list of Related questions on the right:

How can I programmatically change a file's icon?

It seems basically the command for this is:

gvfs-set-attribute -t string /path/to/your/file metadata::custom-icon file:///path/to/your/icon.png

Notes:

1. This doesn't seem to work for Nautilus Scripts in Ubuntu versions before 12.10.

2. This doesn't seem to work for Nautilus Scripts when running Nautilus as root either.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.