Create settings.js

master
RKBoss6 2025-07-22 21:36:54 -04:00 committed by GitHub
parent 4d7d0b3c56
commit 98d0d290e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 25 additions and 0 deletions

25
apps/backlite/settings.js Normal file
View File

@ -0,0 +1,25 @@
(function(back) {
var FILE = "BackLite.settings.json";
// Load settings
var settings = Object.assign({
brightness: 0.3,
}, require('Storage').readJSON(FILE, true) || {});
function writeSettings() {
require('Storage').writeJSON(FILE, settings);
}
// Show the menu
E.showMenu({
"" : { "title" : "BackLite" },
'Brightness': {
value: 0.3|settings.brightness,
min: 0.1, max: 1,
step: 0.1,
onchange: v => {
settings.brightness = v;
writeSettings();
}
},
});
});