Re: [gnome-shell-ext] How does gnome-browser-extension and chrome-gnome-shell load extension without reloading gnome session



The script I was referring to is:
....
#!/bin/bash

array=( disableworkspaceanim owilliams mixxx org lockkeys@fawtytoo netspeed hedayaty gmail com noannoyance daase net Vitals CoreCoding com )

for i in "${array[@]}"
do
    VERSION_TAG=$(curl -Lfs "https://extensions.gnome.org/extension-query/?search=${i}" | jq '.extensions[0] | .shell_version_map | map(.pk) | max')
    wget -O ${i}.zip "https://extensions.gnome.org/download-extension/${i}.shell-extension.zip?version_tag=$VERSION_TAG"
    gnome-extensions install --force ${i}.zip    
    rm ${i}.zip
done

# killall -HUP gnome-shell
# busctl --user call org.gnome.Shell /org/gnome/Shell org.gnome.Shell Eval s 'Meta.restart("Restarting…")'
dbus-send --session --type=method_call --dest=org.gnome.Shell /org/gnome/Shell org.gnome.Shell.Eval string:"global.reexec_self();"

sleep 5s

for i in "${array[@]}"
do
    gnome-extensions enable ${i}
done
....
So, as far i understood, I have two options:

1. Run org.gnome.Shell.Extensions.InstallRemoteExtension from my shell script (using dbus-send or busctl) in my first for loop.

2.
gnome-extensions install --force ${i}.zip  
# Register the newly installed extension with a dbus command (probably dbus-send or busctl)
gnome-extensions enable ${i}

What can be the dbus-send or busctl command for case 1 and case 2.





On Mon, Jul 4, 2022 at 8:34 PM Florian Müllner <fmuellner gnome org> wrote:


On Mon, Jul 4 2022 at 19:47:52 +0600, Ahmad Ismail via
gnome-shell-extensions-list <gnome-shell-extensions-list gnome org>
wrote:
>
> So, how does gnome-browser-extension and chrome-gnome-shell load
> extension without reloading the gnome session?

They don't.

They call the `org.gnome.Shell.Extensions.InstallRemoteExtension` D-Bus
method, and in turn (after confirmation by the user) gnome-shell will
 - download the extension with the specified UUID from
extensions.gnome.org
 - extract it in the user's $HOME
 - register the newly installed extension
 - enable it

You cannot do the registration step without calling into gnome-shell.

Florian




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