Added linux clock

pull/2153/head
David Peer 2022-09-28 21:12:18 +02:00
parent baeaec3694
commit fa8b43c65e
8 changed files with 187 additions and 0 deletions

View File

@ -0,0 +1 @@
0.01: New App.

View File

@ -0,0 +1 @@
# A Linux inspired clock

View File

@ -0,0 +1 @@
require("heatshrink").decompress(atob("mEwgIcah0EgEB/H8iFsAoOY4kMBYMDhmGgXkAoUGiWkAoQQBoAFCjgnCAoM4hgFDuEI+wpC8EKyg1C/0eAoMAsEAiQvBAAeAApQAB/4Ao+P4v/wn0P8Pgn/wnkH4Pjv/j/nn9PH//n/nj/IFF4F88AXBAoM88EcAoPHj//jlDAoOf/+Y+YFHjnnjAjBEIIjD+BHDO9IALA=="))

116
apps/linuxclock/app.js Normal file

File diff suppressed because one or more lines are too long

BIN
apps/linuxclock/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -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

View File

@ -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();
},
}
});
})