From 33179e169a1473436b73086de634403d24e7afdd Mon Sep 17 00:00:00 2001 From: Raymundo Cassani Date: Fri, 22 May 2020 19:08:23 -0400 Subject: [PATCH] Push working desklet template --- .../system-monitor-graph@rcassani/desklet.js | 30 +++++++++++++++++++ .../metadata.json | 8 +++++ 2 files changed, 38 insertions(+) create mode 100644 files/system-monitor-graph@rcassani/desklet.js create mode 100644 files/system-monitor-graph@rcassani/metadata.json diff --git a/files/system-monitor-graph@rcassani/desklet.js b/files/system-monitor-graph@rcassani/desklet.js new file mode 100644 index 0000000..07757c6 --- /dev/null +++ b/files/system-monitor-graph@rcassani/desklet.js @@ -0,0 +1,30 @@ +const Desklet = imports.ui.desklet; +const St = imports.gi.St; + +function MyDesklet(metadata, desklet_id) { + this._init(metadata, desklet_id); +} + +MyDesklet.prototype = { + __proto__: Desklet.Desklet.prototype, + + _init: function(metadata, desklet_id) { + Desklet.Desklet.prototype._init.call(this, metadata, desklet_id); + this.setupUI(); + }, + + setupUI(){ + // creates container for one child + this.window = new St.Bin(); + // creates a label with text + this.text = new St.Label({text: "Hello Desktop"}); + // adds label to container + this.window.add_actor(this.text); + // Sets the container as content actor of the desklet + this.setContent(this.window); + }, +}; + +function main(metadata, desklet_id) { + return new MyDesklet(metadata, desklet_id); +} diff --git a/files/system-monitor-graph@rcassani/metadata.json b/files/system-monitor-graph@rcassani/metadata.json new file mode 100644 index 0000000..8f42712 --- /dev/null +++ b/files/system-monitor-graph@rcassani/metadata.json @@ -0,0 +1,8 @@ +{ + "max-instances": "10", + "uuid": "system-monitor-graph@rcassani", + "name": "System monitor graph", + "description": "Creates graphs for system variables.", + "version": "0.1", + "prevent-decorations": false +}