Skip to content
This repository has been archived by the owner on Sep 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #19 from tty2/feature/follow-guidlines
Browse files Browse the repository at this point in the history
Feature/follow guidelines
  • Loading branch information
tty2 committed Jan 31, 2022
2 parents 43803f2 + c945e32 commit 2bc63ac
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
33 changes: 19 additions & 14 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@ const { Clutter, St, GObject } = imports.gi;
const Main = imports.ui.main;
const PanelMenu = imports.ui.panelMenu;


const bullet = "●";
const circle = "○";
const leftButton = 1;
const rightButton = 3;

let _indicator;

let WorkspaceIndicator = GObject.registerClass(
class WorkspaceIndicator extends PanelMenu.Button {
_init() {
super._init(0.0, _('Workspace Indicator'));
super._init(0.0, _('Horizontal workspace indicator'));

this._container = new St.Widget({
layout_manager: new Clutter.BinLayout(),
Expand Down Expand Up @@ -72,6 +69,22 @@ let WorkspaceIndicator = GObject.registerClass(
}
);

class Extension {
constructor(uuid) {
this._uuid = uuid;
}

enable() {
this._indicator = new WorkspaceIndicator();
Main.panel.addToStatusArea(this._uuid, this._indicator);
}

disable() {
this._indicator.destroy();
this._indicator = null;
}
}

function getWidgetText() {
let txt = "";
let numberWorkspaces = global.workspace_manager.get_n_workspaces();
Expand All @@ -86,14 +99,6 @@ function getWidgetText() {
return txt
}

function init() {
}

function enable() {
_indicator = new WorkspaceIndicator();
Main.panel.addToStatusArea('workspace-indicator', _indicator);
}

function disable() {
_indicator.destroy();
function init(meta) {
return new Extension(meta.uuid);
}
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"description": "Workspace indicator shows the amount of opened workspaces and the current one",
"name": "Workspace indicator",
"shell-version": ["3.38","40", "40.0", "40.0.0", "41"],
"shell-version": ["3.38","40", "41"],
"url": "https://github.com/tty2/horizontal-workspace-indicator",
"uuid": "[email protected]",
"version": "0.0.8"
"version": "0.0.9"
}

0 comments on commit 2bc63ac

Please sign in to comment.