-
-
Save ys/26a79111a1f6d4eed23faa2cbdb7224f to your computer and use it in GitHub Desktop.
Scriptable widget to fake a light phone
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Variables used by Scriptable. | |
// These must be at the very top of the file. Do not edit. | |
// icon-color: pink; icon-glyph: dollar-sign; | |
async function getWidget() { | |
let widget = new ListWidget() | |
widget.addSpacer() | |
widget.backgroundColor = Color.dynamic(new Color("#F4F4F4", 1),new Color("#242424",1)) | |
// Update this list to get the links you want | |
apps = [ | |
{ | |
title: "Mail", | |
shortcut: "message://" | |
}, | |
{ | |
title: "Write", | |
shortcut: "iawriter://open?edit=true&path=/daily.md" | |
}, | |
{ | |
title: "Journal", | |
shortcut: "dayone://post" | |
}, | |
{ | |
title: "Meditate", | |
shortcut: "shortcuts://run-shortcut?name=Meditate" | |
}, | |
] | |
for (let app of apps.slice(0, 5)) { | |
let wt = widget.addText(" " + app.title) | |
wt.textColor = Color.dynamic(new Color("#242424", 1),new Color("#f4f4f4",1)) | |
wt.lineLimit = 1 | |
wt.font = Font.systemFont(48) | |
wt.url = app.shortcut | |
widget.addSpacer() | |
} | |
return widget | |
} | |
let widget = await getWidget() | |
new Notification() | |
Script.setWidget(widget) | |
Script.complete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment