Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Scriptable bugs?
const widget = await createWidget()
if (!config.runsInWidget) {
await widget.presentSmall()
}
Script.setWidget(widget)
Script.complete()
async function createWidget(items) {
Location.setAccuracyToThreeKilometers()
const location = await Location.current()
const darkMode = Device.isUsingDarkAppearance()
const list = new ListWidget()
const header = list.addText("🐞 Debugger".toUpperCase())
header.font = Font.mediumSystemFont(13)
list.addSpacer()
list.addText(darkMode ? "⚫️ Dark" : "⚪️ Light")
list.addSpacer(6)
list.addText(`📍 ${location.latitude.toFixed(1)}, ${location.longitude.toFixed(1)}`)
return list
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment