Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Add support for GNOME Shell 3.34 (#9)
Browse files Browse the repository at this point in the history
* Add support for styling icons with shell theme

* Fixed extension point conflict error

* Fixed "actor" property deprecation warning

* Fixed icon sizing and fill

* fix: read metadata from currentExtension

* Add support for GNOME Shell 3.34

* Retain backwards-compatability with previous GNOME Shell versions

* Update metadata.json

Co-authored-by: Osman Alperen Elhan <[email protected]>
Co-authored-by: Alexandre NICOLAIE <[email protected]>
  • Loading branch information
3 people committed Dec 23, 2019
1 parent 96a9c48 commit 4f6a56f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
3 changes: 2 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"name": "Extensions Sync",
"description": "Sync all extensions and their configurations across all gnome instances through gist",
"shell-version": [
"3.32"
"3.32",
"3.34"
],
"url": "https://github.com/oae/gnome-shell-extensions-sync",
"gettext-domain": "extensions-sync",
Expand Down
26 changes: 20 additions & 6 deletions sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
// along with Extensions Sync. If not, see <http:https://www.gnu.org/licenses/>.
//

const ExtensionSystem = imports.ui.extensionSystem;
const Config = imports.misc.config;
const ExtensionDownloader = imports.ui.extensionDownloader;
const ExtensionSystem = imports.ui.extensionSystem;
const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;

const { Settings } = extensionsSync.imports.settings;
const { getSettings } = extensionsSync.imports.convenience;
Expand All @@ -33,6 +35,12 @@ const debug = logger('sync');
var Sync = class Sync {

constructor() {
if (Config.PACKAGE_VERSION.startsWith("3.34")) {
this.extensionManager = Main.extensionManager;
} else {
this.extensionManager = ExtensionSystem;
}

this.settings = getSettings('org.gnome.shell.extensions.sync');
this.stateChangeHandlerId = null;
this.initializeHandlerId = null;
Expand All @@ -43,9 +51,10 @@ var Sync = class Sync {
enable() {
debug('enabled');

this._initExtensions();

this.initializeHandlerId = setTimeout(() => {
this._initExtensions();
this.stateChangeHandlerId = ExtensionSystem.connect(
this.stateChangeHandlerId = this.extensionManager.connect(
'extension-state-changed',
debounce((event,extension) => this._onExtensionStateChanged(extension),1000)
);
Expand All @@ -54,7 +63,8 @@ var Sync = class Sync {

disable() {
debug('disabled');
ExtensionSystem.disconnect(this.stateChangeHandlerId);

this.extensionManager.disconnect(this.stateChangeHandlerId);
this.stateChangeHandlerId = null;

clearTimeout(this.initializeHandlerId);
Expand Down Expand Up @@ -164,8 +174,12 @@ var Sync = class Sync {
}

_initExtensions() {
this.syncedExtensions = Object.keys(ExtensionUtils.extensions)
.map(extensionId => ExtensionUtils.extensions[extensionId])
this.syncedExtensions = (Config.PACKAGE_VERSION.startsWith("3.34") ?
Main.extensionManager.getUuids() :
Object.keys(ExtensionUtils.extensions))
.map(extensionId => (Config.PACKAGE_VERSION.startsWith("3.34") ?
Main.extensionManager.lookup(extensionId) :
ExtensionUtils.extensions[extensionId]))
.filter(extension => extension.metadata && BLACKLISTED_EXTENSIONS.indexOf(extension.metadata.uuid) < 0)
.reduce((acc,extension) => {

Expand Down

0 comments on commit 4f6a56f

Please sign in to comment.