Skip to content

Instantly share code, notes, and snippets.

@ys
Last active April 14, 2022 14:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ys/26a79111a1f6d4eed23faa2cbdb7224f to your computer and use it in GitHub Desktop.
Save ys/26a79111a1f6d4eed23faa2cbdb7224f to your computer and use it in GitHub Desktop.
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