forked from FOSS/BangleApps
add JSON for widgets, and fix filenames for settings (only 8 chars allowed, so '@setting')
parent
85a5dba9ad
commit
7ea95ddce8
|
@ -63,6 +63,7 @@ the *default* of `To RAM`
|
|||
"name": "Readable name", // readable name
|
||||
"icon": "icon.png", // icon in apps/
|
||||
"description": "...", // long description
|
||||
"type":"...", // optional(if app) - 'app' or 'widget'
|
||||
"tags": "", // comma separated tag list for searching
|
||||
|
||||
"custom": "custom.html", // if supplied, apps/custom.html is loaded in an
|
||||
|
|
18
apps.json
18
apps.json
|
@ -98,17 +98,17 @@
|
|||
{"name":"*slevel","url":"spiritlevel-icon.js","evaluate":true}
|
||||
]
|
||||
},
|
||||
{ "id": "settings",
|
||||
{ "id": "setting",
|
||||
"name": "Settings",
|
||||
"icon": "settings.png",
|
||||
"description": "Show the current angle of the watch, so you can use it to make sure something is absolutely flat",
|
||||
"tags": "tool,system",
|
||||
"storage": [
|
||||
{"name":"+settings","url":"settings.json"},
|
||||
{"name":"-settings","url":"settings.js"},
|
||||
{"name":"=settings","url":"settings-init.js"},
|
||||
{"name":"@settings","url":"settings-default.json","evaluate":true},
|
||||
{"name":"*settings","url":"settings-icon.js","evaluate":true}
|
||||
{"name":"+setting","url":"settings.json"},
|
||||
{"name":"-setting","url":"settings.js"},
|
||||
{"name":"=setting","url":"settings-init.js"},
|
||||
{"name":"@setting","url":"settings-default.json","evaluate":true},
|
||||
{"name":"*setting","url":"settings-icon.js","evaluate":true}
|
||||
]
|
||||
},
|
||||
{ "id": "files",
|
||||
|
@ -127,16 +127,20 @@
|
|||
"icon": "widget-battery.png",
|
||||
"description": "Show the current battery level and charging status in the top right of the clock",
|
||||
"tags": "widget,battery",
|
||||
"type":"widget",
|
||||
"storage": [
|
||||
{"name":"+sbat","url":"widget-battery.json"},
|
||||
{"name":"=sbat","url":"widget-battery.js"}
|
||||
]
|
||||
},
|
||||
{ "id": "sbt",
|
||||
"name": "Bluetooth Widget",
|
||||
"name": "c Widget",
|
||||
"icon": "widget-bluetooth.png",
|
||||
"description": "Show the current Bluetooth connection status in the top right of the clock",
|
||||
"tags": "widget,bluetooth",
|
||||
"type":"widget",
|
||||
"storage": [
|
||||
{"name":"+sbt","url":"widget-bluetooth.json"},
|
||||
{"name":"=sbt","url":"widget-bluetooth.js"}
|
||||
]
|
||||
},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name":"Animals Game",
|
||||
"name":"Animals Game", "type":"app",
|
||||
"icon":"*animals",
|
||||
"src":"-animals"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name":"Asteroids!",
|
||||
"name":"Asteroids!","type":"app",
|
||||
"icon":"*astroid",
|
||||
"src":"-astroid"
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ setWatch(function() {
|
|||
apps = s.list().filter(a=>a[0]=='+').map(app=>{
|
||||
try { return s.readJSON(app); }
|
||||
catch (e) { return {name:"DEAD: "+app.substr(1)} }
|
||||
});
|
||||
}).filter(app=>app.type=="app" || !app.type);
|
||||
var selected = 0;
|
||||
var menuScroll = 0;
|
||||
var menuShowing = false;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name":"Clock",
|
||||
"name":"Clock","type":"app",
|
||||
"icon":"*clock",
|
||||
"src":"-clock"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name":"Compass",
|
||||
"name":"Compass","type":"app",
|
||||
"icon":"*compass",
|
||||
"src":"-compass"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name":"App Manager",
|
||||
"name":"App Manager","type":"app",
|
||||
"icon":"*files",
|
||||
"src":"-files"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name":"GPS Time",
|
||||
"name":"GPS Time","type":"app",
|
||||
"icon":"*gpstime",
|
||||
"src":"-gpstime"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name":"Heart Rate",
|
||||
"name":"Heart Rate","type":"app",
|
||||
"icon":"*hrm",
|
||||
"src":"-hrm"
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var storage = require('Storage');
|
||||
|
||||
const settings = storage.readJSON('@settings') || { HID: false };
|
||||
const settings = storage.readJSON('@setting') || { HID: false };
|
||||
|
||||
var sendHid, next, prev, toggle, up, down, profile;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "Keyboard Control",
|
||||
"name": "Keyboard Control","type":"app",
|
||||
"icon": "*hidkbd",
|
||||
"src": "-hidkbd"
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var storage = require('Storage');
|
||||
|
||||
const settings = storage.readJSON('@settings') || { HID: false };
|
||||
const settings = storage.readJSON('@setting') || { HID: false };
|
||||
|
||||
var sendHid, next, prev, toggle, up, down, profile;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "Music Control",
|
||||
"name": "Music Control","type":"app",
|
||||
"icon": "*hidmsic",
|
||||
"src": "-hidmsic"
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"name":"Open Location",
|
||||
"name":"Open Location","type":"app",
|
||||
"src":"-openloc"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
(function() {
|
||||
var s = require('Storage').readJSON('@settings');
|
||||
var s = require('Storage').readJSON('@setting');
|
||||
var adv = { uart: true };
|
||||
if (s.HID) {
|
||||
// Report from https://notes.iopush.net/custom-usb-hid-device-descriptor-media-keyboard/
|
||||
|
|
|
@ -12,8 +12,8 @@ function debug(msg, arg) {
|
|||
|
||||
function updateSettings() {
|
||||
debug('updating settings', settings);
|
||||
storage.erase('@settings');
|
||||
storage.write('@settings', settings);
|
||||
storage.erase('@setting');
|
||||
storage.write('@setting', settings);
|
||||
}
|
||||
|
||||
function resetSettings() {
|
||||
|
@ -30,7 +30,7 @@ function resetSettings() {
|
|||
}
|
||||
|
||||
try {
|
||||
settings = storage.readJSON('@settings');
|
||||
settings = storage.readJSON('@setting');
|
||||
} catch (e) {}
|
||||
if (!settings) resetSettings();
|
||||
|
||||
|
@ -121,11 +121,11 @@ function showResetMenu() {
|
|||
},
|
||||
// this is include for debugging. remove for production
|
||||
/*'Erase': () => {
|
||||
storage.erase('=settings');
|
||||
storage.erase('-settings');
|
||||
storage.erase('@settings');
|
||||
storage.erase('*settings');
|
||||
storage.erase('+settings');
|
||||
storage.erase('=setting');
|
||||
storage.erase('-setting');
|
||||
storage.erase('@setting');
|
||||
storage.erase('*setting');
|
||||
storage.erase('+setting');
|
||||
E.reboot();
|
||||
}*/
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "Settings",
|
||||
"name": "Settings","type":"app",
|
||||
"icon": "*settings",
|
||||
"src": "-settings"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name":"Speedo",
|
||||
"name":"Speedo","type":"app",
|
||||
"icon":"*speedo",
|
||||
"src":"-speedo"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name":"Spirit Level",
|
||||
"name":"Spirit Level","type":"app",
|
||||
"icon":"*slevel",
|
||||
"src":"-slevel"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name":"Stopwatch",
|
||||
"name":"Stopwatch","type":"app",
|
||||
"icon":"*swatch",
|
||||
"src":"-swatch"
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name":"T-Rex",
|
||||
"name":"T-Rex","type":"app",
|
||||
"icon":"*trex",
|
||||
"src":"-trex"
|
||||
}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name":"Battery Level","type":"widget",
|
||||
"src":"=sbat"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name":"bluetooth","type":"widget",
|
||||
"src":"=sbt"
|
||||
}
|
Loading…
Reference in New Issue