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.

I know how to change an icon this way. Also that doesn't work for folders inside Nautilus, but for application launchers.


What I'm looking for is an equivalent to changing the icon for an application in the launcher, i. e. the Home folder, via

gedit ~/.local/share/applications/nautilus-home.desktop

change home icon

That way you can set an icon type, which is helpful when you later want to change the icon set resp. theme or when you want the best resolution for each size of the icon.

So, I know how I can do this for applications in the launcher - but how can I realize this for icon folders in Nautilus? (In which file these settings are stored and editable with i. e. Gedit?)


For example, I try to change the folder icon for ~/.wine/drive_c. I want to use this Faenza icon (I use Faenza-theme, the icon is called folder-wine.png):

wine icon

I want it to appear in best resolution: smaller as bookmark in Nautilus' sidebar, bigger as folder icon when I search Unity's dash. Using the scalable svg is not a solution, because it looks slightly different from the equivalent png.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

If you want to change the special folder icons (xdg user directories), you'll have to change them by making a custom theme. They are set to a specific name which is provided by the theme, and based on which folders are set as your Music, Documents, Videos, etc… folders.

To set a custom icon name to use from the theme, for the ~/.wine/drive_c folder for example, you can run the following in a terminal:

gvfs-set-attribute ~/.wine/drive_c metadata::custom-icon-name folder-wine

This should make Nautilus use the folder-wine icon. However, this icon will not be used in GTK+ file selectors or other applications. Also, be warned that gvfs-set-attribute does not seem to have an option to unset an attribute on a file.

Note, that if you've previously set a custom icon on the file, within Nautilus directly, you'll have to unset that icon. You can do this by opening the properties dialog for that file in Nautilus, clicking on the button with the icon on it, and choosing "Revert" in the file chooser dialog which opens up.

share|improve this answer
    
@Jakob There is no easy way to do that. I will test an idea I have, and update my question if it works well, though. –  dobey Mar 26 '12 at 13:30
    
@Jakob I'm not entirely sure what your'e asking exactly, about Unity. The dash and launcher probably won't show that icon, and I suspect it won't work in Alt+Tab either. But it will show inside the file manager (Nautilus). –  dobey Mar 27 '12 at 18:49
    
@Jakob Ah. If you've set a custom icon in Nautilus before, you need to unset it? This can be unset in Nautilus itself at least. In the "set a custom icon" file chooser dialog, there is a "Reset" button next to Cancel. –  dobey Mar 28 '12 at 11:47
    
Ok, thanks! Thats better than to remove all custom settings. –  Jakob Mar 28 '12 at 12:25
    
BTW, unsetting these gvfs-set-attribute icons is possible by removing the home file I mentioned above: rm ~/.local/share/gvfs-metadata/home. –  Jakob Mar 28 '12 at 12:28
show 1 more 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.