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 which works on all the platforms, but a shell script method would be ok.
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 which works on all the platforms, but a shell script method would be ok.
I found a solution, and I wrote a function to do the job
thanks all
Thanks to @Ali_AlNoaimi for his solution . I changed it to work with python3 and PyGI :
I don't think that icon files are the same across platforms...
On a Mac, the icons are stored in the application bundle - EG:
In Linux they seem to be in a similar, but different place EG:
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
ImageMagick is pretty good for basic manipulation from the command line. Info at http://www.imagemagick.org/script/index.php