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.

In Ubuntu, is it possible to change the icon for a specific file from the command line? I want to create a shortcut with a custom icon, so I'll need a way to change a specific file's icon. (Instead of changing the icon associated with a filetype, I want to change the icon associated with just one specific file.)

share|improve this question
    
As an example, I might have a script called run.sh saved on the desktop. In this case, how could I change the icon for that specific file? –  Anderson Green Dec 15 '12 at 7:24
    
I don't think that is possible. You may create a .desktop file pointing to your script and change that icon. Anyway I am not sure, lets wait for a good answer –  Web-E Dec 15 '12 at 7:29
    
@Web-E Why do you think it's impossible? It's possible to do this on Windows (e. g., specific icons for individual files in Dropbox), so why not on Ubuntu? –  Anderson Green Dec 15 '12 at 7:30
    
@Web-E Specifically, how can you change a .desktop file's icon using the command line? –  Anderson Green Dec 15 '12 at 7:32
1  
First you need to create .desktop file. From command line you have to create the lines one by one. Icon=<ICON_IMG> this line will change the icon. For existing .desktop file you need to replace that line. You can use sed utility for replacement. –  Web-E Dec 15 '12 at 7:35
show 1 more comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.