Functions

DP - date parser

DP: date parser (Creates a date or a time span from text)

Syntax

dp(date, [pattern])

Arguments

  • date: Date to be used. The Date can be returned by some other function or you can use text. For text dates you can both set it statically using the format '1955y11M12d22h04m00s' to express year 1955, month 11, day 12 at 22:04:00 (all fields are optional), or use 'a/r' (add/remove) operators, so, for example 'a12m3s' will add 12 minutes and 3 secs to current date.
  • pattern: A standard Java Date Time format pattern to parse the date

Examples

FormulaDescription
$dp(0h0m0s)$Today's midnight
$dp(01M01d0h0m0sa1y)$New year's eve
$dp("2010-07-30T16:03:25Z", auto)$Parse date string using ISO / auto format
$dp(05-07-2010, dd-MM-yyyy)$Parse date string using custom date format

FD - fitness data

FD: fitness data (activities data, total steps, calories…)

Syntax

fd(type, [start], [end], [activity/segment], [segment])

Arguments

  • type: Info type, see examples
  • start: Date to be used. The Date can be returned by some other function or you can use text. For text dates you can both set it statically using the format '1955y11M12d22h04m00s' to express year 1955, month 11, day 12 at 22:04:00 (all fields are optional), or use 'a/r' (add/remove) operators, so, for example 'a12m3s' will add 12 minutes and 3 secs to current date.
  • end: Date to be used. The Date can be returned by some other function or you can use text. For text dates you can both set it statically using the format '1955y11M12d22h04m00s' to express year 1955, month 11, day 12 at 22:04:00 (all fields are optional), or use 'a/r' (add/remove) operators, so, for example 'a12m3s' will add 12 minutes and 3 secs to current date.
  • activity/segment: Activity type, eg running, walking and so on (regexp are accepted), optionally you can put segment here
  • segment: Segment when filtering by activity (0 is the first segment the range, -1 the last)

Examples

FormulaDescription
$fd(steps)$Steps today
$fd(cals)$Active calories today
$fd(calsr, a0d, a0d)$Inactive calories today
$fd(dista)$$fd(distu)$Distance today (in local unit)
$fd(dist)$Distance today (in meters)
$tf(fd(time))$Active time today
$fd(steps, r1d, r1d)$Steps yesterday
$fd(count)$Number of activities today
Last activity: $fd(activity, r1d, r0d, -1)$ for $tf(fd(time, r1d, r0d, -1))$ $df("hh:mma", fd(start, r1d, r0d, -1))$Last activity in the last 2 days
$fd(steps, 1w) / mu(abs, (tf(1w, D) + 1))$Average steps per day this week
Active for $tf(fd(time), H)$ hours and $tf(fd(time), m)$ minutesActive time today in hours and minutes
HR max:$fd(hrmax)$, min: $fd(hrmin)$, avg: $fd(hravg)$Max, min and average HR today
HR:$fd(hrmax, r60s, r0s)$Current HR if being recorded
Sleep:$tf(fd(sleept, 22hr1d, r0h))$Sleep time last night
Elevation:$fd(elema)$$fd(elemu)$Elevation gained today in local unit
Floors:$fd(floors)$Floors climbed today

FL - for loops

FL: for loops (execute a statement multiple times)

Syntax

fl(init, stop, increment, loop, [sep])

Arguments

  • init: First value of the i variable
  • stop: Condition valuue to meet in order to stop, eg 10
  • increment: Increment formula, eg i + 1
  • loop: Repeat formula or value, i will be replaced with the var
  • sep: Optional separator between elements

Examples

FormulaDescription
$fl(5, 20, "i + 1", "i", " ")$Write numbers from 5 to 20 spaced
$fl(1, 7, "i + 1", "df(EEE, a + i + d)")$Write short name of next 7 days
$fl(1, tu(seq, 1, 1, 10), "i + 1", "#")$Shows from 1 to 10 # symbols, adding one every minute

GV - global variables

GV: global variables (get value of a global variable)

Syntax

gv(var, [default], [index])

Arguments

  • var: The key of the global to retrieve
  • default: An optional default to return if global is not found
  • index: An optional index to return a specific item in list globals

Examples

FormulaDescription
$gv(fgcolor, #FF0000)$Will return the value of var fgcolor or red color if not found

IF - if conditions

IF: if conditions (if/then/else support with multiple boolean operators)

Syntax

if(condition, then, [else])

Arguments

  • condition: A condition can use any comparison like = (equals), > (greater), >= (greater or equal), < (less), <= (less or equal) combined with boolean operators & (AND) or | (OR) and parenthesis
  • then: Text or function to use if condition is true (so if return value is not empty and not 0)
  • else: Optional text or function to be called if condition is false (so either empty or 0)

Examples

FormulaDescription
$if(df(f)>5, "Week End!", "Workday :(")$Will show Week End! during week ends or Workday :( during workdays
Battery $if(bi(level) = 100, "is fully charged", bi(level) <= 15, "is critically low", "is at " + bi(level) + "%" )$Shows status of battery writing fully charged when full, critical if below 15 or the normal level otherwise
$if(df(MMMM) ~= "a", "Has an A", NO)$Will show Has an A if this month name contains an a (regexp allowed), NO otherwise
$if(wi(code) != CLEAR, "Not Sunny")$Will show not sunny if sky is not clear, nothing otherwise

LI - location info

LI: location info (latitude, longitude, address…)

Syntax

li(type)

Arguments

  • type: Info type, see examples

Examples

FormulaDescription
$li(loc)$Current Locality (ex Hill Valley, if available)
$li(country)$Current Country Name (ex Iceland, if available)
$li(ccode)$Current Country Code (ex US, if available)
$li(addr)$Current Address (if available)
$li(admin)$Current Admin Area (ex CA, if available)
$li(neigh)$Current Neighborhood (if available, locality otherwise)
$li(postal)$Current Postal Code (if available)
$li(spd)$Current Speed in local unit (kmh/mph if available, 0 otherwise)
$li(spdm)$Current Speed in meters per second (if available, 0 otherwise)
$li(spdu)$Current Speed unit (kmh/mph)
$li(alt)$Altitude in local unit (meters/feet with GPS lock only, 0 otherwise)
$li(altm)$Altitude in meters (with GPS lock only, o otherwise)
$li(lat)$Latitude
$li(lon)$Longitude
$li(lplat)$Latitude (low precision ~50m)
$li(lplon)$Longitude (low precision ~50m)

LV - local variables

LV: local variables (get and set local variable values)

Syntax

lv()

Arguments

    Examples

    FormulaDescription
    $lv("foo", "Some Value")$Value is: $lv(foo)$Sets a simple variable and shows value using lv()
    $lv("foo", df(m))$$"Minutes are: "+#foo$Sets a simple variable and shows value using #

    MI - music info

    MI: music info (playing track, artist, album cover…)

    Syntax

    mi(type)

    Arguments

    • type: Info type, see examples

    Examples

    FormulaDescription
    $mi(album)$Current Album (if set)
    $mi(artist)$Current Artist (if set)
    $mi(title)$Current Track Title (if set)
    $tf(mi(len), mm:ss)$Current Track Duration (in mm:ss format)
    $tf(mi(pos), mm:ss)$Current Track Position (in mm:ss format)
    $mi(len)$Current Track Duration (in seconds)
    $mi(pos)$Current Track Position (in seconds)
    $mi(vol)$Current Music Volume (0 to 100)
    $mi(percent)$Current Track Position (in percentage)
    $mi(cover)$Current Cover Image (to be used in Image module or Background as formula)
    $mi(package)$Current Player Package Name
    $mi(track)$Current track in playlist (if available, to be used with mq)
    $ni(mi(package), bicon)$Current Player App Icon (to be used in Image module or Background as formula)
    $mi(state)$Current Player State, one of:: STOPPED, PAUSED, PLAYING, FORWARDING, REWINDING, SKIPPING_FORWARDS, SKIPPING_BACKWARDS, BUFFERING, ERROR, NONE

    MQ - music queue

    MQ: music queue (get current playlist or next track name, duration…)

    Syntax

    mq(type, [index])

    Arguments

    • type: Track Index (len for playlist length)
    • index: Info type, see examples

    Examples

    FormulaDescription
    $mq(title, mi(track) + 1)$Next track title (if available)
    $mq(sub, mi(track) - 1)$Prev track sub title (if available)
    $mq(len)$Playlist length

    MU - math utilities

    MU: math utilities (floor, ceil, sqrt, min, max…)

    Syntax

    mu(var, [default])

    Arguments

    • var: Function (one of ceil, floor or sqrt)
    • default: One or more values depending on the function

    Examples

    FormulaDescription
    $mu(ceil, 3.14)$Will return ceil of 3.14
    $mu(floor, 3.80)$Will return floor of 3.80
    $mu(sqrt, 2)$Will return square root of 2
    $mu(round, 2.80)$Will round 2.80 to the nearest integer
    $mu(round, 2.858284, 2)$Will round number to 2 decimals
    $mu(min, 1, 3)$Will return min between 1 and 3
    $mu(max, 1, 3)$Will return max between 1 and 3
    $mu(abs, -1)$Will return absolute value of -1
    $mu(cos, 90)$Cosine of 90 degrees
    $mu(sin, 90)$Sine of 90 degrees
    $mu(tan, 45)$Tangent of 45 degrees
    $mu(acos, 1)$Inverse Cosine of 1
    $mu(asin, 1)$Inverse Sine of 1
    $mu(atan, 45)$Inverse Tangent of 45 degrees
    $mu(log, 5)$Logarithm of 5
    $mu(pow, 2, 3)$2 raised to the power of 3
    $mu(ln, 5)$Natural logarithm of 5
    $mu(rnd, 10, 100)$Random number between 10 and 100
    $mu(h2d, 5F)$Converts an hex number to decimal
    $mu(d2h, 123)$Converts a decimal number to hex




    Privacy Policy