Skip to content

Instantly share code, notes, and snippets.

@kevinkub
Created October 20, 2020 07:49
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinkub/2b81b259d69926dfb31ccf489f656b8f to your computer and use it in GitHub Desktop.
Save kevinkub/2b81b259d69926dfb31ccf489f656b8f to your computer and use it in GitHub Desktop.
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