I doubt that to achieve your goal there is a platform-agnostic library in any language. I
For GNOME (and probably XFCE), icon icons are called emblems and are managed using gvfs metadata. Here, how you can change the logo through the command line (taken from here ):
$ gvfs-set-attribute $FOLDER -t stringv metadata::emblems new urgent
I am sure that if you delve into the source of the gvfs-set attribute, you will understand the API.
For KDE 4.x, you can use kwriteconfig (taken from here ):
$ kwriteconfig --file "$FOLDER/.directory" --group 'Desktop Entry' --key Icon /path/to/icon.png
On Windows, you must implement the IShellIconOverlayIdentifier COM interface.
For MAC ... I don't know. According to this, there is no official API for this, at least for Mac OS X 10.6.
source
share