6

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.

Axiverse
  • 1,589
  • 3
  • 14
  • 30

1 Answers1

6

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.

Community
  • 1
  • 1
Ihor Kaharlichenko
  • 5,944
  • 1
  • 26
  • 32
  • 1
    Liferay Nativity is a platforma gnostic library. It does not have Python bindings, but that would be a good place to start maybe. – Erik Aronesty Jan 03 '18 at 20:44