mirror of https://github.com/espruino/BangleApps
Added linux clock
parent
baeaec3694
commit
fa8b43c65e
|
@ -0,0 +1 @@
|
|||
0.01: New App.
|
|
@ -0,0 +1 @@
|
|||
# A Linux inspired clock
|
|
@ -0,0 +1 @@
|
|||
require("heatshrink").decompress(atob("mEwgIcah0EgEB/H8iFsAoOY4kMBYMDhmGgXkAoUGiWkAoQQBoAFCjgnCAoM4hgFDuEI+wpC8EKyg1C/0eAoMAsEAiQvBAAeAApQAB/4Ao+P4v/wn0P8Pgn/wnkH4Pjv/j/nn9PH//n/nj/IFF4F88AXBAoM88EcAoPHj//jlDAoOf/+Y+YFHjnnjAjBEIIjD+BHDO9IALA=="))
|
File diff suppressed because one or more lines are too long
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"id": "linuxclock",
|
||||
"name": "Linux Clock",
|
||||
"version": "0.23",
|
||||
"description": "A Linux inspired clock.",
|
||||
"readme": "README.md",
|
||||
"icon": "app.png",
|
||||
"screenshots": [{"url":"screenshot.png"}],
|
||||
"type": "clock",
|
||||
"tags": "clock",
|
||||
"supports": ["BANGLEJS2"],
|
||||
"allow_emulator": true,
|
||||
"storage": [
|
||||
{"name":"linuxclk.app.js","url":"app.js"},
|
||||
{"name":"linuxclk.img","url":"app-icon.js","evaluate":true},
|
||||
{"name":"linuxclk.settings.js","url":"settings.js"}
|
||||
]
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
|
@ -0,0 +1,50 @@
|
|||
(function(back) {
|
||||
const SETTINGS_FILE = "bwclk.setting.json";
|
||||
|
||||
// initialize with default settings...
|
||||
const storage = require('Storage')
|
||||
let settings = {
|
||||
screen: "Normal",
|
||||
showLock: true,
|
||||
hideColon: false,
|
||||
};
|
||||
let saved_settings = storage.readJSON(SETTINGS_FILE, 1) || settings;
|
||||
for (const key in saved_settings) {
|
||||
settings[key] = saved_settings[key]
|
||||
}
|
||||
|
||||
function save() {
|
||||
storage.write(SETTINGS_FILE, settings)
|
||||
}
|
||||
|
||||
var screenOptions = ["Normal", "Dynamic", "Full"];
|
||||
E.showMenu({
|
||||
'': { 'title': 'BW Clock' },
|
||||
'< Back': back,
|
||||
'Screen': {
|
||||
value: 0 | screenOptions.indexOf(settings.screen),
|
||||
min: 0, max: 2,
|
||||
format: v => screenOptions[v],
|
||||
onchange: v => {
|
||||
settings.screen = screenOptions[v];
|
||||
save();
|
||||
},
|
||||
},
|
||||
'Show Lock': {
|
||||
value: settings.showLock,
|
||||
format: () => (settings.showLock ? 'Yes' : 'No'),
|
||||
onchange: () => {
|
||||
settings.showLock = !settings.showLock;
|
||||
save();
|
||||
},
|
||||
},
|
||||
'Hide Colon': {
|
||||
value: settings.hideColon,
|
||||
format: () => (settings.hideColon ? 'Yes' : 'No'),
|
||||
onchange: () => {
|
||||
settings.hideColon = !settings.hideColon;
|
||||
save();
|
||||
},
|
||||
}
|
||||
});
|
||||
})
|
Loading…
Reference in New Issue