Push working desklet template
This commit is contained in:
parent
b7de1f7b8a
commit
33179e169a
30
files/system-monitor-graph@rcassani/desklet.js
Normal file
30
files/system-monitor-graph@rcassani/desklet.js
Normal 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);
|
||||
}
|
||||
8
files/system-monitor-graph@rcassani/metadata.json
Normal file
8
files/system-monitor-graph@rcassani/metadata.json
Normal 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
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user