Imagine this situation: for a given task, at some point of it, I should be able to create an empty file, which I can achieve by touch file.ext on the command line. However, if I touch a .jpg file, and open its folder via graphical interface, I'm going to see the default image icon. This icon gives a visual hint that the file is an image.

But I'd like to set an special icon for these files I'm creating. I'd like something like touch fake-empty-image.jpg --set-icon=/path/to/my-custom-icon.jpg

Is this something possible to do?

Many thanks.

  • 1
    That would entirely depend on what is showing your custom icon. An XDG compliant program? In which case it would need to be done in the .desktop file. – Chris Down Mar 25 '15 at 15:24
  • 1
    Which icon is showed for a file is a parameter defined on the GUI (Gnome, KDE, xfce, etc.) . The first thing to do is define which GUI will be used. – jcbermu Mar 25 '15 at 15:45
  • Thanks, folks. I had to have a different approach for each different GUI. In the end, we decided to leave that only for Apple's MacOs users, for which we had to create . (dot) folder. – Luis Milanese Apr 14 '15 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.