Push working desklet template

This commit is contained in:
Raymundo Cassani 2020-05-22 19:08:23 -04:00
parent b7de1f7b8a
commit 33179e169a
2 changed files with 38 additions and 0 deletions

View File

@ -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);
}

View File

@ -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
}