Skip to content

Commit

Permalink
cleanup (thanks for the review); bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
cbix committed Jul 23, 2022
1 parent 35f0c53 commit a11a493
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 9 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -14,3 +14,5 @@ Dev install:
```
git clone https://github.com/cbix/gsjackctl ~/.local/share/gnome-shell/extensions/[email protected]
```

Or get the latest release by downloading the `[email protected]` asset from the [latest release](https://github.com/cbix/gsjackctl/releases/latest).
2 changes: 1 addition & 1 deletion extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/

const Local = imports.ui.main.extensionManager.lookup('[email protected]');
const Local = imports.misc.extensionUtils.getCurrentExtension();

const {Extension} = Local.imports.gsjackctl.extension;

Expand Down
2 changes: 1 addition & 1 deletion gsjackctl/a2jControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/

const Local = imports.ui.main.extensionManager.lookup('[email protected]');
const Local = imports.misc.extensionUtils.getCurrentExtension();

const {Clutter, GObject} = imports.gi;
const PopupMenu = imports.ui.popupMenu;
Expand Down
2 changes: 1 addition & 1 deletion gsjackctl/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/

const Local = imports.ui.main.extensionManager.lookup('[email protected]');
const Local = imports.misc.extensionUtils.getCurrentExtension();

const {Clutter, GObject} = imports.gi;
const PopupMenu = imports.ui.popupMenu;
Expand Down
12 changes: 10 additions & 2 deletions gsjackctl/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/

const Local = imports.ui.main.extensionManager.lookup('[email protected]');
const Local = imports.misc.extensionUtils.getCurrentExtension();

const {GLib, GObject} = imports.gi;
const Main = imports.ui.main;
Expand All @@ -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;
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
});
Expand Down
2 changes: 1 addition & 1 deletion gsjackctl/indicator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/

const Local = imports.ui.main.extensionManager.lookup('[email protected]');
const Local = imports.misc.extensionUtils.getCurrentExtension();

const {Clutter, GObject, St, Gio, GLib} = imports.gi;
const PanelMenu = imports.ui.panelMenu;
Expand Down
2 changes: 1 addition & 1 deletion gsjackctl/status.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* SPDX-License-Identifier: GPL-2.0-or-later
*/

const Local = imports.ui.main.extensionManager.lookup('[email protected]');
const Local = imports.misc.extensionUtils.getCurrentExtension();

const {Clutter, GObject, St} = imports.gi;
const PopupMenu = imports.ui.popupMenu;
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
],
"url": "https://github.com/cbix/gsjackctl",
"uuid": "[email protected]",
"version": 1
"version": 2
}

0 comments on commit a11a493

Please sign in to comment.