1
0
Fork 0

msgwakefup: new bootloader app

msgwakefup: check for if is new

msgwakefup: try checking file also on fastload
master
thyttan 2024-04-10 22:45:54 +02:00
parent d2b1487315
commit 02135e1a5d
5 changed files with 42 additions and 0 deletions

View File

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

19
apps/msgwakefup/README.md Normal file
View File

@ -0,0 +1,19 @@
# Message Wake On Face Up
Temporarily activate wake on face up function when a new message is auto displayed.
## Usage
This is a bootloader app and only needs to be installed to add the functionality to the watch.
## Notes
Tried with "Message UI" app - with and without "Fastload Utils" installed.
## Requests
Mention @thyttan in an issue on the espruino/BangleApps repository.
## Creator
thyttan and Gordon Williams

BIN
apps/msgwakefup/app.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

9
apps/msgwakefup/boot.js Normal file
View File

@ -0,0 +1,9 @@
// If doing regular loads, not Bangle.load, this is used:
if (global.__FILE__=="messagegui.new.js") Bangle.setOptions({wakeOnFaceUp:true});
// If Fastload Utils is installed this is used:
Bangle.on("message", (_, msg)=>{if (Bangle.CLOCK && msg.new) {
setTimeout(()=>{
if (global.__FILE__=="messagegui.new.js") Bangle.setOptions({wakeOnFaceUp:true});
},700) // It feels like there's a more elegant solution than checking the filename after 700 milliseconds. But this at least seems to work w/o sometimes activating when it shouldn't.
}});

View File

@ -0,0 +1,13 @@
{ "id": "msgwakefup",
"name": "Message wake on face up",
"version":"0.01",
"description": "Temporarily activate wake on face up function when a new message is auto displayed.",
"icon": "app.png",
"tags": "messages,tweak",
"type": "bootloader",
"supports" : ["BANGLEJS2"],
"readme": "README.md",
"storage": [
{"name":"msgwakefup.boot.js","url":"boot.js"}
]
}