diff --git a/apps/widhwbttm/Changelog b/apps/widhwbttm/Changelog new file mode 100644 index 000000000..7c9547033 --- /dev/null +++ b/apps/widhwbttm/Changelog @@ -0,0 +1,2 @@ +0.01: Fork of widclkbttm (Digital clock bttom widget) + diff --git a/apps/widhwbttm/README.md b/apps/widhwbttm/README.md new file mode 100644 index 000000000..2427ff818 --- /dev/null +++ b/apps/widhwbttm/README.md @@ -0,0 +1,30 @@ +# hw stats bttom widget (bottom widget area) +A basic HW/performance monitor widget that shows on real time some technical info, such as free mem, free storage, trash mem, files, FW version. Also allows to test the unfrequently used widget bottom area. + +Compatible with BangleJS1,BangleJS2,and EMSCRIPTENx emulators + +forked from widclkbttm (Digital clock bttom widget) + + +## Photo + +Example of usage + +![](widhwbttm.ss1.jpg) +![](widhwbttm.ss2.jpg) + + + + +## Usage + +Upload the widget file +Open an app (not a clock/watchface) that supports displaying widgets (included the bottom one) +Different info is refreshed following a predefined frequency and sequence. + + +## Support + +This app is so basic that probably the easiest is to just edit the code ;) + +Otherwise you can contact me [here](https://github.com/dapgo/my_espruino_smartwatch_things) \ No newline at end of file diff --git a/apps/widhwbttm/metadata.json b/apps/widhwbttm/metadata.json new file mode 100644 index 000000000..053be5a36 --- /dev/null +++ b/apps/widhwbttm/metadata.json @@ -0,0 +1,15 @@ +{ + "id": "widhwbttm", + "name": "HW stats (Bottom) widget", + "shortName": "Digital clock Bottom Widget", + "version": "0.01", + "description": "Displays technical info and mem stats in the bottom of the screen (may not be compatible with some apps)", + "icon": "widhwbttm.png", + "type": "widget", + "tags": "widget", + "supports": ["BANGLEJS","BANGLEJS2"], + "readme": "README.md", + "storage": [ + {"name":"widhwbttm.wid.js","url":"widhwbttm.wid.js"} + ] +} diff --git a/apps/widhwbttm/widhwbttm.info b/apps/widhwbttm/widhwbttm.info new file mode 100644 index 000000000..c92adad11 --- /dev/null +++ b/apps/widhwbttm/widhwbttm.info @@ -0,0 +1 @@ +{"id":"widhwbttm.wid.js","name":"hw stats bttom widget","type":"widget","version":"0.01","files":"widhwbttm.info,widhwbttm.wid.js"} \ No newline at end of file diff --git a/apps/widhwbttm/widhwbttm.png b/apps/widhwbttm/widhwbttm.png new file mode 100644 index 000000000..82ad43795 Binary files /dev/null and b/apps/widhwbttm/widhwbttm.png differ diff --git a/apps/widhwbttm/widhwbttm.ss1.jpg b/apps/widhwbttm/widhwbttm.ss1.jpg new file mode 100644 index 000000000..65910bf26 Binary files /dev/null and b/apps/widhwbttm/widhwbttm.ss1.jpg differ diff --git a/apps/widhwbttm/widhwbttm.ss2.jpg b/apps/widhwbttm/widhwbttm.ss2.jpg new file mode 100644 index 000000000..7556832b2 Binary files /dev/null and b/apps/widhwbttm/widhwbttm.ss2.jpg differ diff --git a/apps/widhwbttm/widhwbttm.wid.js b/apps/widhwbttm/widhwbttm.wid.js new file mode 100644 index 000000000..d251cf2f0 --- /dev/null +++ b/apps/widhwbttm/widhwbttm.wid.js @@ -0,0 +1,45 @@ +(function() { + var v_switch; // show stats + if (process.env.BOARD=='BANGLEJS'||process.env.BOARD=='EMSCRIPTEN') v_font_size=16 + else v_font_size=13; + var v_str_hw=new String(); + if (v_switch == null || v_switch == '') v_switch=0; + function draw(){ + if (!Bangle.CLOCK == !this.width) { // if we're the wrong size for if we have a clock or not... + this.width = Bangle.CLOCK?0:60; + return setTimeout(Bangle.drawWidgets,1); // widget changed size - redraw + } + if (!this.width) return; // if size not right, return + + if (v_switch==0) { + //var v_hw=process.memory(); + v_str_hw=process.memory().free+"/"+process.memory().total; + v_switch++; + } else if (v_switch==1) { + // var v_hw=process.env.VERSION; + v_str_hw="V:"+process.env.VERSION; + v_switch++; + } else if (v_switch==2) { + v_str_hw="M:"+process.env.BOARD; + v_switch++; + } else { + stor=require("Storage").getStats(); + if (v_switch==3) { + v_str_hw="St:"+stor.freeBytes; + v_switch++; + } else if (v_switch==4) { + v_str_hw="TrB:"+stor.trashBytes; + v_switch++; + } else if (v_switch==5) { + v_str_hw="Fil:"+stor.fileCount; + v_switch=0; + } + } + g.reset().setFontVector(v_font_size).setFontAlign(-1, 0).setColor("#0ff"); + //clean a longer previous string + g.drawString(" ", this.x, this.y+11, true); + g.drawString(v_str_hw, this.x, this.y+11, true); + } //end draw + +WIDGETS["wdhwbttm"]={area:"bl",width:Bangle.CLOCK?0:60,draw:draw}; +})()