Re: Having a hard time programming shell extensions



On 13.08.2016 17:41, Mario Wenzel wrote:
Hi Shell List,

recently I find myself having a hard time programming extensions for the
gnome-shell. Most of the things I want to do, I have no idea how to
start (or if it is possible with a sensible amount of work).

Yes, I have had the same experience, programming extensions. The docs,
if existent, are hard to come by. Sometimes they are wrong.
Often, looking at other shell extensions gives you a clue how to do things.

For the things I currently want to do with some extensions I would need
to do OAuth2 and xml-Parsing. I have problems finding any documentation
on how to do anything. We no longer even have an API-Browser. The linked
browser on developer.gnome.org (http://docs.ptomato.name:9292/) no
longer works.

Interersting! I've never heard of that API Browser. Very exactly is it
linked on developer.gnome.org?


Regarding XML parsing:

There is a "Simple XML Subset Parser" in GLib, but sadly it is not
available for the Javascript bindings [1].

For XML parsing, I use a third party javascript library in my shell
extension, namely sax-js [2].
If you want to see an example, for how to integrate this into your shell
extension, you can refer to my extension [3].

I cannot help with OAuth2.

I think the shell and shell-extensions is one of the first contact
points for users that want to add functionality to their gnome
experience and the barriers for that are just too high.
The lack of examples I can live with but the lack of API documentation
for other languages than C makes it really hard for non-C-people like me
to do anything.

You can generate HTML API docs yourself (e.g. for GLib) by running

# g-ir-doc-tool --language gjs -o ~/yelp-doc/
/usr/share/gir-1.0/GLib-2.0.gir
# mkdir ~/html-doc
# cd ~/html-doc
# yelp-build html ~/yelp-doc/


Furthermore, there is a collection of gjs binding docs [4], but it is
incomplete and it seems rather old. I don't know whether it is up to date.


Kind regards,

Jay




[1]
https://mail.gnome.org/archives/gnome-shell-list/2015-October/msg00008.html
[2] https://github.com/isaacs/sax-js
[3]
https://github.com/jaystrictor/gnome-shell-extension-syncthing/blob/master/filewatcher.js
[4] https://people.gnome.org/~gcampagna/docs/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]