gnome-shell/SOURCES/0001-shellDBus-Add-a-DBus-method-to-load-a-single-extensi.patch

67 lines
2.2 KiB
Diff
Raw Normal View History

2019-11-05 19:43:42 +00:00
From 660ebe0125b591355116934ee57b08010e05246c Mon Sep 17 00:00:00 2001
2019-05-07 12:23:00 +00:00
From: Rui Matos <tiagomatos@gmail.com>
Date: Fri, 8 Nov 2013 11:36:04 +0100
Subject: [PATCH] shellDBus: Add a DBus method to load a single extension
This allows e.g. gnome-tweak-tool to install an extension from a zip
file and load it into the running shell.
---
2019-11-05 19:43:42 +00:00
.../org.gnome.Shell.Extensions.xml | 13 +++++++++++++
js/ui/shellDBus.js | 16 ++++++++++++++++
2 files changed, 29 insertions(+)
2019-05-07 12:23:00 +00:00
2019-11-05 19:43:42 +00:00
diff --git a/data/dbus-interfaces/org.gnome.Shell.Extensions.xml b/data/dbus-interfaces/org.gnome.Shell.Extensions.xml
index 34a65af44..ce69439fc 100644
--- a/data/dbus-interfaces/org.gnome.Shell.Extensions.xml
+++ b/data/dbus-interfaces/org.gnome.Shell.Extensions.xml
@@ -189,6 +189,19 @@
-->
<method name="CheckForUpdates"/>
+ <!--
+ LoadUserExtension:
+ @uuid: The UUID of the extension
+ @success: Whether the operation was successful
+
+ Load a newly installed user extension
+ -->
+
+ <method name="LoadUserExtension">
+ <arg type="s" direction="in" name="uuid"/>
+ <arg type="b" direction="out" name="success"/>
+ </method>
+
<signal name="ExtensionStatusChanged">
<arg type="s" name="uuid"/>
<arg type="i" name="state"/>
2019-05-07 12:23:00 +00:00
diff --git a/js/ui/shellDBus.js b/js/ui/shellDBus.js
2019-11-05 19:43:42 +00:00
index 19d07acce..112d60feb 100644
2019-05-07 12:23:00 +00:00
--- a/js/ui/shellDBus.js
+++ b/js/ui/shellDBus.js
2019-11-05 19:43:42 +00:00
@@ -341,6 +341,22 @@ var GnomeShellExtensions = class {
2019-05-07 12:23:00 +00:00
ExtensionDownloader.checkForUpdates();
2019-11-05 19:43:42 +00:00
}
2019-05-07 12:23:00 +00:00
+ LoadUserExtension(uuid) {
+ let extension = ExtensionUtils.extensions[uuid];
+ if (extension)
+ return true;
+
+ let dir = Gio.File.new_for_path(GLib.build_filenamev([global.userdatadir, 'extensions', uuid]));
+ try {
+ extension = ExtensionUtils.createExtensionObject(uuid, dir, ExtensionUtils.ExtensionType.PER_USER);
+ ExtensionSystem.loadExtension(extension);
+ } catch (e) {
+ log('Could not load user extension from %s'.format(dir.get_path()));
+ return false;
+ }
+ return true;
2019-11-05 19:43:42 +00:00
+ }
2019-05-07 12:23:00 +00:00
+
2019-11-05 19:43:42 +00:00
get ShellVersion() {
return Config.PACKAGE_VERSION;
}
2019-05-07 12:23:00 +00:00
--
2019-11-05 19:43:42 +00:00
2.21.0
2019-05-07 12:23:00 +00:00