[gnome-shell] Add small gnome-shell-extension-prefs script



commit 55f74bb8635a553be5918674666a30c00ff9a383
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Apr 27 21:57:33 2020 +0200

    Add small gnome-shell-extension-prefs script
    
    Commit d76162c1c047c 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 8030d9ad323e, 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

 .gitignore                      |  1 -
 src/gnome-shell-extension-prefs | 31 +++++++++++++++++++++++++++++++
 src/meson.build                 |  4 ++++
 3 files changed, 35 insertions(+), 1 deletion(-)
---
diff --git a/.gitignore b/.gitignore
index 38d6765cc9..396a628e51 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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
diff --git a/src/gnome-shell-extension-prefs b/src/gnome-shell-extension-prefs
new file mode 100755
index 0000000000..303b1963c0
--- /dev/null
+++ b/src/gnome-shell-extension-prefs
@@ -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
diff --git a/src/meson.build b/src/meson.build
index 46680d5b42..546d3a64b5 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -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',


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