From f746b0c67cc3729542a4bbc42c026e6de16ea3ce Mon Sep 17 00:00:00 2001 From: MaBecker Date: Sun, 29 Mar 2020 18:52:10 +0200 Subject: [PATCH] add widget version --- apps.json | 11 +++++++++++ apps/widver/ChangeLog | 1 + apps/widver/widget.js | 11 +++++++++++ apps/widver/widget.png | Bin 0 -> 344 bytes 4 files changed, 23 insertions(+) create mode 100644 apps/widver/ChangeLog create mode 100644 apps/widver/widget.js create mode 100644 apps/widver/widget.png diff --git a/apps.json b/apps.json index 15acb3b20..12903f95d 100644 --- a/apps.json +++ b/apps.json @@ -836,5 +836,16 @@ {"name":"marioclock.app.js","url":"marioclock-app.js"}, {"name":"marioclock.img","url":"marioclock-icon.js","evaluate":true} ] + }, + { "id": "widver", + "name": "Firmware Version Widget", + "icon": "widget.png", + "version":"0.01", + "description": "Display the version of the installed firmware in the top widget section.", + "tags": "widget,tool,system", + "type":"widget", + "storage": [ + {"name":"widver.wid.js","url":"widget.js"} + ] } ] diff --git a/apps/widver/ChangeLog b/apps/widver/ChangeLog new file mode 100644 index 000000000..adb5b038a --- /dev/null +++ b/apps/widver/ChangeLog @@ -0,0 +1 @@ +0.01: New Widget diff --git a/apps/widver/widget.js b/apps/widver/widget.js new file mode 100644 index 000000000..b5edfc08c --- /dev/null +++ b/apps/widver/widget.js @@ -0,0 +1,11 @@ +/* jshint esversion: 6 */ +(() => { + var width = 28, + ver = process.env.VERSION.split('.'); + function draw() { + g.reset().setColor(0, 0.5, 1).setFont("6x8", 1); + g.drawString(ver[0], this.x + 2, this.y + 4, true); + g.setFontAlign(0, -1, 0).drawString(ver[1], this.x + width / 2, this.y + 14, true); + } + WIDGETS["version"] = { area: "tr", width: width, draw: draw }; +})(); diff --git a/apps/widver/widget.png b/apps/widver/widget.png new file mode 100644 index 0000000000000000000000000000000000000000..72e646a30471367725c001956df1274def0dafdc GIT binary patch literal 344 zcmV-e0jK_nP)Jw!7z!$$Z#QY4ycoKvLXQhXuA$3 z8cA3q0O(0%=HA=f%x)9|Qi;zv`9T<=Xq>D{AVnn!D+Pf6C9D+yekHQb=-+)MvOmY# zwN@wa4-}Aw0@6@G8VX250cj{84F#m3fHV}4Ci9>8y6$GK90vufMJXzuK;;FL)+&dk qm%GiLn?7)8QuzcbFF*((vb+J73rQEfJXV?z* literal 0 HcmV?d00001