0

According to this answer (and comments) gnome-contacts is where contacts are centralized for Gnome and it does a good job of aggregating via telepathy, but the only way to access that information seems to be the Gnome Shell search provider which only provides an avatar and a name. I've been struggling to duplicate portions of gnome-contacts in gjs but having tons of trouble with the bindings.

Is there an easier way to achieve this, or is it possible for me to generate vapi/gir binding for gnome-contacts itself so I can use it like a library?

Possible Alternate Solution:

Using libfolks in GJS is currently blocked by Bug #694115, but for those only needing Google Contacts it is possible in GJS via GData and you can even use Gnome Online Accounts as an authentication source, if available.

andy.holmes
  • 3,383
  • 17
  • 28

1 Answers1

1

Use libfolks, which is what gnome-contacts uses internally to source its data. libfolks should be usable via gjs, although this has not been extensively tested, so there might be binding issues.

Please report any binding issues here.

Philip Withnall
  • 5,293
  • 14
  • 28
  • Is there a list of known libraries good for GJS? It seems like I'll need to use libgee, but there is no GJS version of the docs and trying to build them with g-ir-doc-tool failed, which makes me wonder. – andy.holmes Jun 14 '17 at 20:58
  • After some playing, it seems as though Gee can be imported as usual, but Folks returns Gee objects that are missing all the documented methods. – andy.holmes Jun 15 '17 at 03:25
  • I don’t have enough experience with GJS to answer this, sorry. If you file a bug against folks on bugzilla.gnome.org, with a minimal example of what’s failing, I’ll try to take a look. – Philip Withnall Jun 16 '17 at 09:10
  • My mistake, I was interpreting the docs incorrectly. The closest thing to gjs docs is the vala docs, and I'm having a time learning libfolks from that. – andy.holmes Jun 18 '17 at 00:11
  • NB, there is GJS documentation but it seems not to have libfolks: http://devdocs.baznga.org/ – ptomato Jun 18 '17 at 21:17
  • Yes, I've seen those, thank you. I also tried compiling libfolks docs with g-ir-doc-tool but failed. There's so little example code for libfolks or libgee outside of vala code that I'm not sure if I'm using it wrong or if the bindings just don't work, but I don't seem to be able to get data out of any Gee objects (which just seem like a layer of complication to me anyways). – andy.holmes Jun 22 '17 at 23:12
  • There are very few examples of libfolks outside of Vala, indeed. Please file bugs on bugzilla.gnome.org about anything you think should work, but doesn’t. – Philip Withnall Jun 23 '17 at 09:01
  • While in the process of filing a bug I saw that [Bug 694115](https://bugzilla.gnome.org/show_bug.cgi?id=694115) is still open, as well as the nightmarish gintrospection bug blocking it. Since I'm writing a gnome-shell extension, distributing the discussed Vala/C "shim" might not be feasible, if anyone has even written such a thing. Thanks for your time, I'll look into some other options. – andy.holmes Jun 25 '17 at 00:07