From a11a4932adb506af96b6cb0a4e0a42a6ea3a7063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20H=C3=BClsmann?= Date: Sun, 24 Jul 2022 01:10:23 +0200 Subject: [PATCH] cleanup (thanks for the review); bump version --- README.md | 4 +++- extension.js | 2 +- gsjackctl/a2jControl.js | 2 +- gsjackctl/control.js | 2 +- gsjackctl/extension.js | 12 ++++++++++-- gsjackctl/indicator.js | 2 +- gsjackctl/status.js | 2 +- metadata.json | 2 +- 8 files changed, 19 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 7e4afff..9b24338 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # gsjackctl – GNOME Shell JACK Control -_This GNOME Shell-extension is a work in progress._ +_I'm not actively working on this extension anymore since I personally switched to PipeWire, however if there are people using it I'll try to keep it updated for new gnome-shell versions and will accept bugfix PRs!_ ## About **gsjackctl** is a simple GNOME extension to control the JACK audio system. It works only with jack2 using jackdbus. @@ -14,3 +14,5 @@ Dev install: ``` git clone https://github.com/cbix/gsjackctl ~/.local/share/gnome-shell/extensions/gsjackctl@cbix.de ``` + +Or get the latest release by downloading the `gsjackctl@cbix.de.zip` asset from the [latest release](https://github.com/cbix/gsjackctl/releases/latest). diff --git a/extension.js b/extension.js index 806cf68..f3ef6cf 100644 --- a/extension.js +++ b/extension.js @@ -7,7 +7,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ -const Local = imports.ui.main.extensionManager.lookup('gsjackctl@cbix.de'); +const Local = imports.misc.extensionUtils.getCurrentExtension(); const {Extension} = Local.imports.gsjackctl.extension; diff --git a/gsjackctl/a2jControl.js b/gsjackctl/a2jControl.js index 17e6f65..c5b1190 100644 --- a/gsjackctl/a2jControl.js +++ b/gsjackctl/a2jControl.js @@ -7,7 +7,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ -const Local = imports.ui.main.extensionManager.lookup('gsjackctl@cbix.de'); +const Local = imports.misc.extensionUtils.getCurrentExtension(); const {Clutter, GObject} = imports.gi; const PopupMenu = imports.ui.popupMenu; diff --git a/gsjackctl/control.js b/gsjackctl/control.js index a24bf0d..302ff34 100644 --- a/gsjackctl/control.js +++ b/gsjackctl/control.js @@ -7,7 +7,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ -const Local = imports.ui.main.extensionManager.lookup('gsjackctl@cbix.de'); +const Local = imports.misc.extensionUtils.getCurrentExtension(); const {Clutter, GObject} = imports.gi; const PopupMenu = imports.ui.popupMenu; diff --git a/gsjackctl/extension.js b/gsjackctl/extension.js index 6350c93..2507de3 100644 --- a/gsjackctl/extension.js +++ b/gsjackctl/extension.js @@ -7,7 +7,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ -const Local = imports.ui.main.extensionManager.lookup('gsjackctl@cbix.de'); +const Local = imports.misc.extensionUtils.getCurrentExtension(); const {GLib, GObject} = imports.gi; const Main = imports.ui.main; @@ -26,6 +26,7 @@ var Extension = class Extension { this._status = null; this._buffersize = 256; this._backgroundRunning = false; + this._backgroundSource = null; // TODO make this configurable this._a2jAutostart = true; @@ -134,6 +135,13 @@ var Extension = class Extension { disable() { this._indicator.destroy(); this._indicator = null; + this._jackctl = null; + this._a2jControl = null; + this._status = null; + this._control = null; + if (this._backgroundSource && this._backgroundRunning) + GLib.Source.remove(this._backgroundSource); + } updateStatus() { @@ -171,7 +179,7 @@ var Extension = class Extension { startBackground(interval = 2000) { if (this.updateStatus() && !this._backgroundRunning) { this._backgroundRunning = true; - GLib.timeout_add(GLib.PRIORITY_DEFAULT, interval, () => { + this._backgroundSource = GLib.timeout_add(GLib.PRIORITY_DEFAULT, interval, () => { this._backgroundRunning = this.updateStatus(); return this._backgroundRunning; }); diff --git a/gsjackctl/indicator.js b/gsjackctl/indicator.js index c835b5a..aa81f8f 100644 --- a/gsjackctl/indicator.js +++ b/gsjackctl/indicator.js @@ -7,7 +7,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ -const Local = imports.ui.main.extensionManager.lookup('gsjackctl@cbix.de'); +const Local = imports.misc.extensionUtils.getCurrentExtension(); const {Clutter, GObject, St, Gio, GLib} = imports.gi; const PanelMenu = imports.ui.panelMenu; diff --git a/gsjackctl/status.js b/gsjackctl/status.js index dd2334d..e75fd5d 100644 --- a/gsjackctl/status.js +++ b/gsjackctl/status.js @@ -7,7 +7,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ -const Local = imports.ui.main.extensionManager.lookup('gsjackctl@cbix.de'); +const Local = imports.misc.extensionUtils.getCurrentExtension(); const {Clutter, GObject, St} = imports.gi; const PopupMenu = imports.ui.popupMenu; diff --git a/metadata.json b/metadata.json index be024fb..b6e6500 100644 --- a/metadata.json +++ b/metadata.json @@ -9,5 +9,5 @@ ], "url": "https://github.com/cbix/gsjackctl", "uuid": "gsjackctl@cbix.de", - "version": 1 + "version": 2 }