RAM clkinfo
parent
a7cf5e70bc
commit
815110da60
|
|
@ -0,0 +1 @@
|
||||||
|
0.01: First version
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
# RAM Clock Info
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A clock info that displays the % memory used
|
||||||
|
|
||||||
|
## Screenshots
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Written by: [Hugh Barney](https://github.com/hughbarney) For support and discussion please post in the [Bangle JS Forum](http://forum.espruino.com/microcosms/1424/)
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 206 B |
|
|
@ -0,0 +1,61 @@
|
||||||
|
(function () {
|
||||||
|
var timeout;
|
||||||
|
|
||||||
|
var debug = function(o) {
|
||||||
|
//console.log(o);
|
||||||
|
};
|
||||||
|
|
||||||
|
var clearTimer = function() {
|
||||||
|
if (timeout) {
|
||||||
|
clearTimeout(timeout);
|
||||||
|
timeout = undefined;
|
||||||
|
debug("timer cleared");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var queueRedraw = function() {
|
||||||
|
clearTimer();
|
||||||
|
timeout = setTimeout(function() {
|
||||||
|
timeout = undefined;
|
||||||
|
queueRedraw();
|
||||||
|
}, 60000);
|
||||||
|
info.items[0].emit("redraw");
|
||||||
|
debug("queued");
|
||||||
|
};
|
||||||
|
|
||||||
|
var img = function() {
|
||||||
|
return atob("GBgBAAAAAAAAAAAAB//gD//wH//4HgB4HAA4HAA4HAA4HDw4HDw4HDw4HDw4HAA4HAA4HAA4HgB4H//4D//wB//gAAAAAAAAAAAA");
|
||||||
|
};
|
||||||
|
|
||||||
|
var text = function() {
|
||||||
|
var val = process.memory(false);
|
||||||
|
return '' + Math.round(val.usage*100 / val.total) + '%';
|
||||||
|
};
|
||||||
|
|
||||||
|
var info = {
|
||||||
|
name: "Bangle",
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
name: "ram",
|
||||||
|
get: function () { return ({
|
||||||
|
img: img(),
|
||||||
|
text: text()
|
||||||
|
}); },
|
||||||
|
run : function() {
|
||||||
|
debug("run");
|
||||||
|
queueRedraw();
|
||||||
|
},
|
||||||
|
show: function () {
|
||||||
|
debug("show");
|
||||||
|
this.run();
|
||||||
|
},
|
||||||
|
hide: function() {
|
||||||
|
debug("hide");
|
||||||
|
clearTimer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
|
return info;
|
||||||
|
});
|
||||||
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"id": "clkinfom",
|
||||||
|
"name": "RAM Clock Info",
|
||||||
|
"version":"0.01",
|
||||||
|
"description": "Clockinfo that displays % used memory",
|
||||||
|
"icon": "app.png",
|
||||||
|
"screenshots": [{"url":"screenshot.png"}],
|
||||||
|
"type": "clkinfo",
|
||||||
|
"tags": "clkinfo",
|
||||||
|
"supports" : ["BANGLEJS2"],
|
||||||
|
"readme":"README.md",
|
||||||
|
"storage": [
|
||||||
|
{"name":"ram.clkinfo.js","url":"clkinfo.js"}
|
||||||
|
]
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 2.8 KiB |
Loading…
Reference in New Issue