How Can I Get an Icon or thumbnail for a Specific file

后端 未结 4 1925
北恋
北恋 2021-01-25 06:01

I am searching for a way to get the icon associated with a certain file type on Linux.

Either using a shell script or python.

I prefer a native python method whi

4条回答
  •  感动是毒
    2021-01-25 06:40

    I don't think that icon files are the same across platforms...

    On a Mac, the icons are stored in the application bundle - EG:

    /Applications/Mail.app/Contents/Resources/app.icns
    

    In Linux they seem to be in a similar, but different place EG:

     /usr/lib/firefox/icons/mozicon16.xpm
    

    So, I think you are out of luck for an easy, cross-platform solution and will have to code the routine to look into the appropriate place for each OS

提交回复
热议问题