Skip to content

Instantly share code, notes, and snippets.

@IT-Delinquent
Created October 12, 2022 09:32
Show Gist options
  • Save IT-Delinquent/de333e5f5820353a8f82724f27367cd7 to your computer and use it in GitHub Desktop.
Save IT-Delinquent/de333e5f5820353a8f82724f27367cd7 to your computer and use it in GitHub Desktop.
garminSimpleWatchFaceExample.mc
// 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