Sassan
Sassan

Reputation: 2337

Docs for developing gnome shell extensions

I need to know when inFullscreen of monitor object is set to true, I wanna make sure it's not set to true when window is maximized. I can't find any docs for imports.ui.main nor any imports.ui.*. That's simple (but still annoying) I can hold alt and press F2 and type lg then enter to try it in the repl. But what if I need some info about queueDeferredWork?

Or what if I wanna know if there's a signal like switch-workspace but when the switch is finished (when switch-workspace is triggered it SEEMS that the switch animation just began and at least inFullscreen doesn't return true when I switch to a fullscreen workspace, it just SEEMS so, I can't make sure as I can't find docs for it.)

Is gnome-shell api (except imports.gi.*) not documented? or am I missing something?

Upvotes: 2

Views: 1090

Answers (1)

andy.holmes
andy.holmes

Reputation: 3696

There was very similar question asked here: How do I get the monitor of an active window in GNOME?

Sorry I didn't see your question earlier; you should use the tags [gnome-shell-extensions] and [gjs] to ellicit help for more programming related questions.

Updated September 2021

As of, well awhile ago, GJS has its own portal for tutorials, documentation and so on.

  • https://gjs.guide

    Everything below is linked to from this portal, so it's a good bookmark.

    There are guides covering all the basics, much of the advanced usage, introductions to core libraries like GLib and GTK, including some specialized tutorials like spawning subprocesses. There is also a dedicated section for extensions, covering creation, translations, preferences and porting guides to get your extension working on the latest release.

    Please - do request any documentation you find lacking. It may not always be feasible or quick, but we'll do our best.

  • https://gjs-docs.gnome.org

    This is GJS's official API documentation for the GNOME platform, including all core libraries and all the other libraries like GStreamer and WebKit you expect. If a library is missing, you can request it by opening an issue.

    For GNOME Shell extensions, these will be of particular interest (see the Architecture page for more details):

    • Clutter: The compositor-side toolkit, part of Mutter
    • Meta: The window manager and/or compositor (aka Mutter)
    • St: Builds on Clutter to add more complex widgets and CSS
    • Shell: The internal library of GNOME Shell, providing several classes and functions
    • Gvc: High-level bindings for PulseAudio. Not strictly a part of GNOME Shell, but used by it and worth noting.

This documentation is still correct, however it is probably best for those familiar with the GNOME platform that just need some hints for GJS.

As JavaScript is (now) evolving fairly quickly, it is highly advised you familiarize yourself with GNOME Shell's JavaScript source. Aside from being crucial to writing extensions, this is the best way to keep up with new features in JavaScript and GJS, including patterns for using them.

HELP!

Upvotes: 1

Related Questions