Skip to content

Instantly share code, notes, and snippets.

@ys

ys/light_phone_widget.js Secret

Last active Feb 18, 2021
Embed
What would you like to do?
Scriptable widget to fake a light phone
// 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