powermanager - Adds setting for widget

pull/2560/head
Martin Boonk 2023-02-20 20:56:12 +01:00
parent b334b14f40
commit ce46760922
2 changed files with 10 additions and 0 deletions

View File

@ -24,6 +24,12 @@
'title': 'Power Manager'
},
"< Back" : back,
'Show widget': {
value: !!settings.widget,
onchange: v => {
writeSettings("widget", v);
}
},
'Monotonic percentage': {
value: !!settings.forceMonoPercentage,
onchange: v => {

View File

@ -1,6 +1,10 @@
/* run widgets in their own function scope so they don't interfere with
currently-running apps */
(() => {
const s = require("Storage").readJSON("powermanager.json") || {};
if (!s.widget) return;
const GU = require("graphics_utils");
const APPROX_IDLE = 0.3;
const APPROX_HIGH_BW_BLE = 0.5;