-
• #2
You can use a special filename starting with .bootN (N can be 0 1 2 3) to store additional code you want to load/execute at boot time.
Bangle.js is using .boot0, so use .boot3 for your settings.
require('Storage').write('.boot3', ` // place your settings here `)
-
• #3
As @MaBe said...
There's an issue open for adding some extra settings for this kind of thing (https://github.com/espruino/BangleApps/issues/134) - it'd be interesting to see what you find useful to change, so they can be added as user-configurable options without needing the code above
-
• #4
Regarding .bootN, wouldn't it be better if the apps could register a js file to be called from one of these files, otherwise the 0-3 would quickly be filled up, as eg the DST change might eg also need to called on startup, see other thread for this issue.
-
• #5
Yes, it's a good point. Can't find this anywhere now but I think it was discussed before - I just filed an issue for it: https://github.com/espruino/BangleApps/issues/163
-
• #6
Ok, thanks all :)
-
• #7
If you update JS firmware now, you can do this instead:
require('Storage').write('custom.boot.js', ` Bangle.setOptions({...}) `)
Hi,
I tweaked a few settings for my Bangle using Bangle.setOptions, but they don't seem to survive a reboot.
For example I changed wakeOnBTN2 and wakeOnBTN3 to false. After E.reboot() they seem to be set to true again. How can I save these settings?