Get file icon from extension, file type, or mime-type
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Get file icon from extension, file type, or mime-type
Is there any way to get a file's icon from its extension? I'm currently making a FTP program in Qt and I want to be able to have the correct file type icons. I'd prefer some way is cross-DE and is capable of working on most linux systems.
According to this site: http://standards.freedesktop.org/sha...html#s2_layout
I should have a <MIME>/icons folder that maps mime types to icons. I checked and I do not have this folder or the generic-icons folder. I do have the other ones. I tried running update-mime-database but it does not create those folders.
Any idea? This would be what I'm looking for. Is this not implemented yet?
I have solved my problem. I made a bash script that when given the file name, greps the mime.types file for the mime type. Then the mimetype is formatted in the icon format, and is found with the find command. This works with DE's that are compliant with that mime standard.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.