Re: Documentation for gnome-shell's Extension API



hi;

On 13 May 2014 16:17, Jon Kristensen <info jonkri com> wrote:
On Thu, 2014-05-08 at 14:38 +0100, Emmanuele Bassi wrote:
Also, on my Fedora 20 box, I have a bunch of JavaScript files
in /usr/share/gnome-shell/js that I can look through. However, on an
Arch Linux installation of mine (running GNOME 3.12), this directory
doesn't exist.

they are "compressed" into a single binary by default, but they can be
extracted, see this blog post about it:

http://blogs.gnome.org/mclasen/2014/03/24/keeping-gnome-shell-approachable/

Hi, again!

Thanks for your answers!

I have a follow-up question in regards to these extracted files.

I got going with extensions development by iteratively installing the
extension under development, pressing Alt+F2, and typing 'r' to restart
GNOME Shell and thus reload the extension. This is a bit cumbersome, and
it seems to me that I might be Doing It Wrong.

that's pretty much how extensions work, so no: it's expected.

Is there some way that I
could run the extension without restarting GNOME Shell, such as by
running it with gjs?

no, you can't.

If I try to run the extension.js file using gjs, I'm getting a warning
like "(gjs:4023): Gjs-WARNING **: JS ERROR: Error: No JS module 'ui'
found in search path extension js:14". When I add a path to the "js"
directory using imports.searchPath.unshift, I get an error saying
"(gjs:4055): Gjs-CRITICAL **: JS ERROR: SyntaxError: syntax error
@ .../js/ui/endSessionDialog.js:46 JS_EvaluateScript() failed".

This fails at some D-Bus introspection XML, or something like that.
Should I perhaps "import" libgnome-shell.so instead? How would I do
that?

you don't. extensions are executed in the shell process, so you can't
use them outside of it.

ciao,
 Emmanuele.

-- 
W: http://www.emmanuelebassi.name
B: http://blogs.gnome.org/ebassi/


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