I'm trying to figure out how to add and modify badge icons to individual files on the filesystem much like how Dropbox adds the sync icon to files. I want to do this across platforms and am looking to see what language would be best. Right now I think python is the candidate, but I'm open for other languages that this problem might already be solved in.
I doubt there's a platform-agnostic library in any language to achieve your goal. I
For GNOME (and probably XFCE) the badge icons are called emblems and are manipulated via gvfs metadata. Here's how you can change the emblem via command line (taken from here):
$ gvfs-set-attribute $FOLDER -t stringv metadata::emblems new urgent
I'm pretty sure if you dig into the source of gvfs-set-attribute you'd figure out 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 are supposed to implement an IShellIconOverlayIdentifier COM interface.
For MAC... I don't know. According to this there's no official API to do that at least for Mac OS X 10.6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With