/garminSimpleWatchFaceExample.mc Secret
Created
October 12, 2022 09:32
Star
You must be signed in to star a gist
garminSimpleWatchFaceExample.mc
This file contains 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
// Get and show the current time | |
var clockTime = System.getClockTime(); | |
var timeString = Lang.format("$1$:$2$", [clockTime.hour, clockTime.min.format("%02d")]); | |
updateDisplayObject("TimeLabel", timeString); | |
//Get and show the current battery percentage | |
var pwr = System.getSystemStats().battery; | |
var batStr = Lang.format( "$1$%", [ pwr.format( "%2d" ) ] ); | |
updateDisplayObject("BatteryPercentageLabel", batStr); | |
//Get and show the steps data | |
var stepCountString = ActivityMonitor.getInfo().steps.toString(); | |
updateDisplayObject("StepsLabel", stepCountString); | |
//Get and show the date | |
var now = Time.now(); | |
var info = Calendar.info(now, Time.FORMAT_LONG); | |
var dateString = Lang.format("$1$ $2$ $3$", [info.day_of_week, info.day, info.month]); | |
updateDisplayObject("DateLabel", dateString); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment