gnome-extensions-cli icon indicating copy to clipboard operation
gnome-extensions-cli copied to clipboard

Install extensions from GitHub

Open rauldipeas opened this issue 1 year ago • 8 comments

It's possible to implement something like this?

Since gnome.org is offline sometimes, would be great to have an command line option to install directly from GitHub releases or something like this.

rauldipeas avatar Oct 24 '24 13:10 rauldipeas

Hi this could be a good feature to implement. But the key feature of this project is to use dbus to tell gnome to install an extension.

Do you know if it is possible to install an extension from a GitHub repository with your browser?

An alternative would be to download the latest release zip from GitHub and install it with the file backend instead of the dbus backend... and to be honest I don't like this that much.

essembeh avatar Oct 30 '24 00:10 essembeh

I think that install from file is the only possible approach...

Why don't you like this? Some security concern?

rauldipeas avatar Oct 30 '24 00:10 rauldipeas

Not really for security reason, but more from a design point of view.

In Gext there are 2 backends with an abstraction (see here) to allow common actions with both backends: dbus backend if you are running a graphical session, file backend for ssh/tty sessions...

Having a feature only for one backend breaks this design a little ... but why not.

I would go for something like gext sideload https://github.com/foo/bar/release-v4.2.zip? I'm not sure for the sideload verb, but as exeplained, I don't want to reuse the install verb since this feature would only be available with the file backend.

essembeh avatar Oct 30 '24 09:10 essembeh

Great, I think it could be implemented in this way.

Instead of full path, maybe, you can use only gext github-install user/repo or something short like this.

rauldipeas avatar Oct 30 '24 15:10 rauldipeas

The problem with short url (like owner/repo for github) is that it is not easy to "guess" the zip url from it. I first thought using the main branch zip would be enough but some extensions need to be built / packaged... Moreover using the latest version might not be stable and not compatible with your current gnome version.

Do you have an example of extension you would like to install from GitHub as an example?

essembeh avatar Oct 30 '24 17:10 essembeh

I don't think this should be so abrangent.

It should have a disclaimer that work only on zip or tar.gz/tar.xz availiable extensions, ready for install through unpack.

That's my example list... #arcmenu [email protected] #blur my shell blur-my-shell@aunetx #debian-updates-indicator [email protected] #emoji copy emoji-copy@felipeftn #extensions-sync [email protected] #forge [email protected] #notification banner reloaded [email protected] #pano [email protected] #status area horizontal spacing [email protected] #tray-icons-reloaded [email protected] #user themes [email protected]

rauldipeas avatar Oct 30 '24 18:10 rauldipeas

These extensions are available in the Gnome Extensions Website I guess. I would like to have an example of an extension you want to install from Github directly ?

essembeh avatar Oct 30 '24 22:10 essembeh

That's exactly my point, Gnome Extensions Website was offline sometimes on the past few weeks.

In this moments, there's no alternative to install extensions.

rauldipeas avatar Oct 30 '24 22:10 rauldipeas

Why did you close this, @rauldipeas?

I would go for something like gext sideload https://github.com/foo/bar/release-v4.2.zip?

@essembeh I totally agree, that sounds like a great option without having to guess anything. And it would support any sources, not only GitHub.

felipecrs avatar Sep 02 '25 16:09 felipecrs

Almost a year later and no response, so, I'm not expecting this to be done anytime in the future.

I've made my own solution.

rauldipeas avatar Sep 02 '25 16:09 rauldipeas

It should be relatively easy to contribute this feature though. Especially with the help of some GenAI. :D

felipecrs avatar Sep 02 '25 16:09 felipecrs

I started a branch to work on this but I was never satisfied with the result.

A: As it is not possible to install such archives with dbus messages., the sideload action would only be available with the filesystem backend, which is a "fallback" in gext. Initially gext is meant to use the dbus backend, there are plenty of alternative that use the filesystem backend (zip extract) and I found it insecure, that is why I wanted a CLI tool to use DBUS.

B: There is no gnome version compatibility check also, which is a big problem to me. I wanted a way to check gnome shell compatibility (which is automatically done with dbus backend, and easy with filesystem backend).

C: And last thing, as the zip are available on github, it would have been mandatory to "check" that the zip is a valid gnome extension, which is not trivial at all. I don't want to extract a zip without being sure of what it is.

And for all that reasons, I ended up giving up on that idea which was not a bad idea at all. I can't see how to fix point A without working on Gnome Dbus installer itself. Point B & C are quite linked, and if I could find a reliable lib for parse/validate gnome extensions zip file, the I could have use it...

Hope this clarifies the story ;)

essembeh avatar Sep 05 '25 16:09 essembeh

The validation can be done by checking the GNOME extension website filiation?

rauldipeas avatar Sep 05 '25 23:09 rauldipeas

The validation can be done by checking the GNOME extension website filiation?

That means that in the sideload function, I would need a way to retrieve the https://extensions.gnome.org/extension/XXXX url of the extension zip.

I take an example with a popular extension: https://extensions.gnome.org/extension/3088/extension-list/ The project is https://github.com/tuberry/extension-list/

That means that from https://github.com/tuberry/extension-list/releases/tag/48.0 page should be able to retrieve https://extensions.gnome.org/extension/3088/extension-list/ which means I need to inspect the source code from within the attached zip files (also I need to retrieve a manifest from the developper project tree, I'm not a gnome extension developped, but I doubt there is a common project layout)

But there is something I don't get with this use case. Why would I need to install an extension from a zip from github if the extension is published on gnome official website and I can install it with gext install 3088 ?

From your original request @rauldipeas it is in the case gnome website is down, so I think I should find a way to check gnome compatibility without the gnome website ?

essembeh avatar Sep 07 '25 12:09 essembeh

I think You can make a validated list while the extensions site is online and save it to check this list when you script run, maybe.

rauldipeas avatar Sep 08 '25 00:09 rauldipeas