2

I had wanted to compose an answer for Making a symlink for a bin file and renaming it to "readme" (w/o extension) gives it text file properties quoting the relevant part of the source code that chose file icons based on file name.

After spending considerable time doing some digging, I was unable to find it in the Unity source or the compiz source, and the GNOME source (where I suspect this is) consists of a huge number of projects that I had extreme difficulty searching. I was unable to come up with any information that I could use in an answer, and the mission was a failure.

So my question is: Where is some source relevant to the determination of human-readable file type descriptions and desktop icon selection for files on Ubuntu (14.04, and these features have been around for a while so I don't think it really matters which version of the components are in use)? Or at least, which projects might this source be in?

The part I'm looking for is that final step of "figure out the icon", which is of course based on e.g. the icon specified in a .desktop file, or a registered icon for another type of file, or a built-in default icon, etc.

  • look at man file to what I think might be how Ubuntu does it in general – George Udosen Apr 3 '17 at 23:14
  • 1
    @George It's possible that some component in the system at some point either shells out to file or uses similar logic for non-.desktop files, what I'm really interested in is the ultimate destination of that info and the point where it determines which icon to use based on that info. You've given me another path to research, though. If I can find exactly where it e.g. calls file (for example) or does that logic for general (not *.desktop) files, I'm sure I can trace through from there to find what I'm looking for. I just wish I knew what component did all this... – Jason C Apr 3 '17 at 23:28
1

If you're using Ubuntu's Unity 7 shell, start by looking at the code for the BAMF project. Yeah, sure, guy who named the project had a sense of humour, but that's the component where the icons mostly get figured out.

Your Answer

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

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