Add small gnome-shell-extension-prefs script

Commit d76162c1c0 removed the ability to pass an extension UUID to
the Extensions app, when we moved the dialog to a portal and made
gnome-shell use it instead of spawning the extensions app.

However that missed that many extensions called out to the app to
open their own prefs.

While extensions are encouraged to switch to the new openPrefs()
convenience method added in commit 8030d9ad32, restore the old
behavior with a small script under the old gnome-shell-extension-prefs
name that either calls out to the portal or launches the app.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1220
This commit is contained in:
Florian Müllner 2020-04-27 21:57:33 +02:00
parent b02e3719b3
commit 55f74bb863
3 changed files with 35 additions and 1 deletions

1
.gitignore vendored
View File

@ -60,7 +60,6 @@ src/calendar-server/evolution-calendar.desktop
src/calendar-server/org.gnome.Shell.CalendarServer.service
src/gnome-shell
src/gnome-shell-calendar-server
src/gnome-shell-extension-prefs
src/gnome-shell-extension-tool
src/gnome-shell-hotplug-sniffer
src/gnome-shell-perf-helper

31
src/gnome-shell-extension-prefs Executable file
View File

@ -0,0 +1,31 @@
#!/bin/sh
openPrefs() {
if [ "$(which gnome-extensions)" ]
then
gnome-extensions prefs $1
else
gdbus call --session \
--dest=org.gnome.Shell.Extensions \
--object-path=/org/gnome/Shell/Extensions \
--method=org.gnome.Shell.Extensions.OpenExtensionPrefs $1 '' '{}'
fi
}
cat >&2 <<EOT
gnome-shell-extension-prefs is deprecated
Install https://flathub.org/apps/details/org.gnome.Extensions for extension
management, or use the gnome-extensions command line tool.
Extensions can use the ExtensionUtils.openPrefs() method.
EOT
UUID=$1
if [ "$UUID" ]
then
openPrefs $UUID
else
gapplication launch org.gnome.Extensions
fi

View File

@ -31,6 +31,10 @@ foreach tool : script_tools
)
endforeach
install_data('gnome-shell-extension-prefs',
install_dir: bindir
)
gnome_shell_cflags = [
'-DCLUTTER_ENABLE_EXPERIMENTAL_API',
'-DCOGL_ENABLE_EXPERIMENTAL_API',