Created
October 20, 2020 07:49
-
-
Save kevinkub/2b81b259d69926dfb31ccf489f656b8f to your computer and use it in GitHub Desktop.
Scriptable bugs?
This file contains hidden or 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
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