Commit Graph

50 Commits

Author SHA1 Message Date
Andy Holmes
3dc4f01113
JS: migrate from the global window to globalThis
As of mozjs68 (gjs-1.64) `globalThis` is recommended over `window` and
it makes more sense in this context anyways. Migrate the few instances
of `window` we use and adjust the eslint configuration.

`window` will continue to resolve to `globalThis`, so this won't affect
extensions or other downstream users.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2322

closes #2322
2020-04-26 19:07:02 -07:00
Jan Tojnar
9f1ad5d86d extension-tool/build: Install completions relative to our datadír
It is a good practice to install files relative to our own variables

https://www.bassi.io/articles/2018/03/15/pkg-config-and-paths/

and it is required on systems like NixOS.

Thanks to Iñigo, bash-completion support that since 2.10:

https://github.com/scop/bash-completion/pull/344

---

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/1194
2020-04-13 15:27:09 +00:00
Florian Müllner
1b5cf0b8a8 build: Bump version requirement
We are currently optionally using a 0.53 feature, bump the requirement
to make it non-optional.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1186
2020-04-07 23:13:27 +02:00
Florian Müllner
306b005943 extensions-tool: Add small indicator template
Adding an additional icon to the top bar is one of the more common
patterns used by extensions. Make this easier by providing a template
for it.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/812
2020-04-07 20:27:00 +00:00
Florian Müllner
d229abf07d extensions-tool: Prompt for template when appropriate
When creating an extension interactively, we currently always use
the default template unless the --template option is used.

Instead, display the list of available templates to the user and
prompt them to pick one if it wasn't specified.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/812
2020-04-07 20:27:00 +00:00
Florian Müllner
6f6251c0bc extensions-tool: Add --template create option
We now have everything in place to allow users to pick a template
other than the default one (although at the moment it's the only
one we have), so add a corresponding option.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/812
2020-04-07 20:27:00 +00:00
Florian Müllner
fd034e3551 extensions-tool: Add hidden --list-templates option
This isn't a very useful option on its own, but will be used to
provide completions for a user-visible --template option.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/812
2020-04-07 20:27:00 +00:00
Florian Müllner
f9bee05d49 extensions-tool: Add template metadata
When we allow users to choose between different templates, we should
provide some context for each template to facilitate that choice.

Add that metadata in the form of a .desktop file, which allows us to
specify name and description, and is well supported by our translation
infrastructure.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/812
2020-04-07 20:27:00 +00:00
Florian Müllner
37c6fbc6b2 extensions-tool: Prepare for alternative templates
The template used when creating a new extension is intentionally
minimal, as the sample code in the old extensions-tool proved to
be annoying more often than not.

However as we support per-command options, we don't have to limit
ourselves to a single template, and can offer alternatives for
common use cases.

To prepare for that, namespace the existing template by moving it
into a subfolder.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/812
2020-04-07 20:27:00 +00:00
Florian Müllner
9719604b79 extensions-tool: Separate create metadata when prompting
When using the create command's --interactive option, we prompt for
any metadata that wasn't passed on the command line. As every prompt
is preceded by a short multi-line description, it is hard to follow
when everything is lumped together.

Improve legibility by separating all prompts by newlines.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/812
2020-04-07 20:27:00 +00:00
Florian Müllner
b6262f0666 extensions-tool: Handle NULL input when prompting for metadata
g_data_input_stream_read_line_utf8() may return NULL, for example
when interrupting the prompt with ^D. Handle that case and keep
prompting until we got a line.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/812
2020-04-07 20:27:00 +00:00
Florian Müllner
d80ef67d1d extension-tool: Use enable/disable D-Bus API if possible
Commit 4589da957 added D-Bus API for enabling/disabling extensions,
use that if possible to provide better feedback and not clutter the
settings with non-existent UUIDs.

The old code path is preserved as fallback to keep the commands
working from outside a running shell session.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2391
2020-04-05 13:42:50 +02:00
Florian Müllner
62f3457a95 extensions-tool/uninstall: Error out for system extensions
UninstallExtensions() only returns whether the operation was successful,
not why it failed. However we know that only user extensions can be
uninstalled, so check that first to provide a more meaningful error.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2391
2020-04-05 13:42:50 +02:00
Florian Müllner
636ab4b0e9 extensions-tool: Split out get_extension_property() helper
For the prefs command, we first fetch the extension info to check
whether the extension exists and actually has preferences. This
pattern can be useful for other commands and properties, so split
out a generic helper function.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2391
2020-04-05 13:42:50 +02:00
Florian Müllner
23e382dd33 extensions-tool: Log existing errors
In many cases we currently only indicate failure in the return value,
which is easily missed. Print some meaningful errors instead.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2391
2020-04-05 13:42:50 +02:00
Florian Müllner
f5a170ce46 extensions-tool: Add common option to silence errors
Error reporting is useful when used interactively, but often undesirable
when used in scripts. Account for that with a common --quiet option,
which is more convenient than redirection stderr to /dev/null.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2391
2020-04-05 13:42:50 +02:00
Florian Müllner
fbd6beea2c extensions-app: Validate .desktop file during meson test
... if desktop-file-validate is available.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1160
2020-04-05 11:02:00 +00:00
Florian Müllner
360f5b1642 extensions-app: Add category in .desktop file
Predefined categories aren't a great way for organizing installed
applications, but they have their use in "stores" like Software
or flathub.

Not listing any category means we fall through the cracks, so
pick the (hopefully) least inappropriate one ...

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1160
2020-04-05 11:02:00 +00:00
Florian Müllner
f0a785df9d extensions-app: Add developer name in metainfo
Unlike Software, flathub doesn't fall back to the "project group"
when no developer is specified, so add one.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1160
2020-04-05 11:02:00 +00:00
Florian Müllner
e2c1bfbedd extensions-app: Add flathub badge to README
The app is now on flathub, so brag about that.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1160
2020-04-05 11:02:00 +00:00
Florian Müllner
0a4974ac8c extensions-app: Do not expand headerbar switch
https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2563
2020-04-03 02:29:55 +00:00
Florian Müllner
764527c8c9 js: Promisify async operations
Promises make asynchronous operations easier to manage, in particular
when used through the async/await syntax that allows for asynchronous
code to closely resemble synchronous one.

gjs has included a Gio._promisify() helper for a while now, which
monkey-patches methods that follow GIO's async pattern to return a
Promise when called without a callback argument.

Use that to get rid of all those GAsyncReadyCallbacks!

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1126
2020-03-31 05:43:40 +00:00
Florian Müllner
18742fcc32 build: Post-release version bump
With 3.36.1 out, let's start the next development cycle ...
2020-03-31 00:36:48 +02:00
Florian Müllner
c2cacc63ee extensions-app: Point homepage in metainfo to subproject
This is where the app code is located now, so it makes for a less
surprising landing page than the toplevel gnome-shell directory.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1150
2020-03-29 17:49:08 +00:00
Florian Müllner
c226081a23 extensions-app: Update README
Add the icon and use the app name instead of the subproject name.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1150
2020-03-29 17:49:08 +00:00
Florian Müllner
73df61f36d extensions-app: Add flatpak manifest
We finally have everything in place for distributing the Extensions app
as flatpak without jumping through too many hoops. Add a manifest that
can produce a nightly build like other GNOME modules, and can serve as
a template for a stable manifest on flathub.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1133
2020-03-27 23:33:30 +00:00
Florian Müllner
39e6375aff extensions-app: Move Extensions app to new subproject
The Extensions app code is now independent enough from the rest of the code
base to move it to its own subprojects, like we did for the extensions-tool.

This allows for stand-alone builds of the app, which we are about to use
for distributing it as flatpak.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1133
2020-03-27 23:33:30 +00:00
Florian Müllner
6baf490aab shew: Add small library for dealing with external windows
In order to support OpenExtensionPrefs()'s parentWindow parameter,
we will need the ability to make a window transient to an external
window identified by a string handle.

This takes the corresponding code from xdg-desktop-portal-gtk and
brings it into an introspectable form, likewise the counterpart in
libportal to export a string handle for a GtkWindow.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1087
2020-03-26 18:32:30 +01:00
Florian Müllner
fb9854c003 extensions-tool: Use new Extensions proxy
While sandboxing isn't a concern for the gnome-extensions command line
tool, using the Extensions proxy directly means that D-Bus methods are
called from the tool rather than gnome-shell, which allows the proxy
to auto-shutdown when done.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1106
2020-03-23 15:39:12 +00:00
Florian Müllner
7f6e2ff36b extensions-tool: Use OpenExtensionPrefs() method
LaunchExtensionPrefs() was deprecated in commit fda938175e,
so switch to the replacement.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1097
2020-03-22 15:31:07 +01:00
Florian Müllner
04352ae158 build: Add configuration summaries
Meson now has a summary() function to easily summarize the build
configuration after the project was configured, use that for some
fancy output when the feature is available.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1072
2020-03-21 20:44:43 +01:00
Florian Müllner
5c5dc03b78 build: Make bash-completion support optional
Whether we install bash-completion support currently depends on whether
the corresponding pkg-config dependency is found.

Turning this into a feature option keeps that behavior by default, but
also allows to explicitly enable or disable the support.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1072
2020-03-21 20:44:43 +01:00
Florian Müllner
8a89e22e8e build: Use fixed gettext domain for non-subproject extension-tool builds
Clarify how the option is supposed to be used by
 - ignoring it for non-subproject builds
 - enforcing that it is set for subproject builds

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1072
2020-03-21 20:44:43 +01:00
Florian Müllner
8f851e8adf build: Yield 'man' option to extension-tool subproject
Turns out meson has a build-in pattern of what we are doing, namely:
Set a subproject option to a parent project option of the same name.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1072
2020-03-21 20:44:43 +01:00
Florian Müllner
dc002a61eb build: Assert extension-tool version is bumped alongside gnome-shell
I always forget to keep the extension-tool version number in sync when
doing a new release. Given that it's unlikely that I'll do much better
in the future by myself, make distcheck fail when the versions don't
match.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1076
2020-03-21 18:00:25 +00:00
Florian Müllner
bf367daaba build: Fix some harmless compiler warnings
Some (newer?) GCC versions complain when a g_auto variable isn't
initialized when declared, even when the initialization is guaranteed
to happen before the variable is used or goes out of scope.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/2298
2020-03-08 00:34:36 +00:00
Florian Müllner
1de008f2d5 Bump extensions-tool version as well 2020-03-08 01:33:20 +01:00
Florian Müllner
224ab2e543 extensions-tool: Add option to list updates
Now that we support extension updates, it may be useful to list
pending updates from the command line. It's easy enough to support,
so add a corresponding option to the list command.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/988
2020-02-10 22:43:00 +00:00
Chuck
d1f87ca115 extension-tool: Don't treat missing .js handler as error
After creating a new extension, we try to open the main source
file with the default handler, which fails when there is none.

But given that the extension was created successfully, don't treat
a missing handler as failure, and print the path to the new extension
instead.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/905
2019-12-20 14:11:03 +00:00
Florian Müllner
624cf1dad4 extensions-tool: Set up translations for standalone builds
While we can now build gnome-extensions-tool as stand-alone project,
we are currently missing any translations, as those are part of
gnome-shell.

The easiest option for addressing this would be to symlink the toplevel
po directory into the subproject, however that would mean duplicating
the entire gnome-shell message catalogs.

So instead, set up a bare po directory and provide a script to populate
it from the translations in the toplevel po directory.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/877
2019-12-18 19:13:24 +00:00
Florian Müllner
4e9154ca64 extensions-tool: Add (back) README.md
This was dropped when importing the project into gnome-shell. Now
that is a bit more separate again, it makes sense to add it back.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/877
2019-12-18 19:13:24 +00:00
Florian Müllner
51518d4d96 extensions-tool: Move to a subproject
The gnome-extensions tool code is really independent from the rest of the
code base, and could be used either as part of the gnome-shell build or as
stand-alone project (for example for the extension-ci docker image).

We can actually support both cases by moving the code to a subproject.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/877
2019-12-18 19:13:24 +00:00
Florian Müllner
c506eda20a gvc: Update submodule
gnome-volume-control now has API to expose the stream state, which
we will need in the following commit.

https://gitlab.gnome.org/GNOME/gnome-shell/issues/53
2019-11-23 15:16:51 +01:00
Robert Mader
7127fb1fa1 gvc: Update submodule to up-to-date version
This frees us from all remaining '‘g_type_class_add_private’ is deprecated'
warnings.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/427
2019-02-28 21:59:08 +01:00
Iñigo Martínez
6e74f987ec build: Update gvc to support renamed options
gvc has made some recent changes that rename its user options
following meson guidelines for GNOME packages[0].

The options used in gvc as a subproject have been renamed
accordingly.

[0] https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting
2018-01-30 13:37:38 +01:00
Bastien Nocera
9b6a931b43 build: Update gvc to not require ALSA support
ALSA support is only used in gnome-settings-daemon, so always disable
the option, which wouldn't work on non-Linux anyway.
2018-01-26 11:24:03 +01:00
Florian Müllner
f96b0d43fa Update gvc 2017-08-10 20:16:06 +02:00
Florian Müllner
2aceeac7e0 build: Update gvc subproject 2017-07-20 01:28:35 +02:00
Florian Müllner
c987d3d2c9 build: Support the meson build system
Meson is on track to replace autotools as the build system of choice,
so support it in addition to autotools. If all goes well, we'll
eventually be able to drop the latter ...

https://bugzilla.gnome.org/show_bug.cgi?id=783229
2017-07-20 00:20:54 +02:00
Florian Müllner
7f4e914b00 build: Move gvc submodule to /subprojects/gvc
When using the meson build system, gvc will be built as a subproject.
As meson restricts submodules to a subprojects/ directory in the
source tree root, move the submodule there.

https://bugzilla.gnome.org/show_bug.cgi?id=783229
2017-07-19 21:24:08 +02:00