ThemeStore Store Docs FAQ
Documentation

Formula variables

Every value a formula can read, grouped by subject. Generated from the launcher's own catalogue.

On this page

Everything below is available inside $…$. Some variables only mean something in a particular place: app_name inside an app field, item_* inside a repeater card, scrub_* inside a scrub strip, page_position relative to the page the element sits on.

This table is generated from the same catalogue the app's editor offers, and a test fails the build if the two ever disagree, so it cannot describe a variable the launcher does not have, and cannot omit one it does.

Repeater entries add item_<key> variables of their own, named after the keys of the data; those are not listed here because they depend on the source. See repeaters.

Screen#

NameTypeWhat it is
screen_widthnumberWidth of the screen in dp.
screen_heightnumberHeight of the screen in dp.
status_bar_heightnumberHeight of the status bar in dp. Use it instead of a fixed top margin — it differs per device.
nav_bar_heightnumberHeight of the system navigation bar in dp; 0 on gesture navigation.
inset_leftnumberLeft display cutout / rounded-corner inset in dp. Non-zero mainly in landscape.
inset_rightnumberRight display cutout inset in dp.
ime_heightnumberHeight of the on-screen keyboard in dp, measured from the bottom edge of the screen (so it includes the navigation bar). 0 while the keyboard is closed. Follows the keyboard frame by frame while it slides in or out.
is_landscapeyes/noTrue while the device is held in landscape.
font_scalenumberThe system font-size factor (1.0 = default). Multiply your own text sizes by it to respect the user's accessibility setting.

Time and date#

NameTypeWhat it is
time_hournumberHour of the current time, 0–23.
time_minutenumberMinute of the current time, 0–59.
time_secondnumberSecond of the current time, 0–59. A field that reads it updates every second — use it only where a ticking clock is the point.
date_daynumberDay of the month, 1–31.
date_monthnumberMonth of the year, 1–12.
date_yearnumberFour-digit year.
weekday_nametextLocalised name of the weekday, e.g. "Tuesday".
month_nametextLocalised name of the month, e.g. "September".

Device#

NameTypeWhat it is
dark_modeyes/noTrue while the system is in dark theme.
reduce_motionyes/noTrue when the person has switched animations off ("Remove animations" in accessibility). Themes decide for themselves what to do with it: leave a movement out, or make it smaller.
battery_levelnumberBattery charge in percent, 0–100.
is_chargingyes/noTrue while the device is plugged in.
wifi_connectedyes/noTrue while the device is on Wi-Fi.

Pages and scrolling#

NameTypeWhat it is
page_indexnumberIndex of the page this element sits on, counted along its row.
page_countnumberNumber of pages in the row this page belongs to.
page_positionnumberSigned distance of this page from the one on screen: 0 while it is centred, -1 one page to the left, +1 to the right, fractional while a swipe is in progress. The variable most parallax and fade effects are built on.
page_scroll_fractionnumber1 while a page swipe is in progress, 0 at rest. A switch, not a slider: use it to show something only while swiping. For a value that grows with the swipe, use page_swipe_progress.
page_swipe_progressnumberHow far the current page swipe has got: 0 at rest, rising smoothly to 1 when the swipe reaches the neighbouring page. Built for blends that follow the finger.
page_rownumberRow of the page in the 2D page grid; 0 is the classic home row.
page_row_positionnumberRow position while a vertical page change is running, moving with it: 2, then 2.4, then 3. page_row only snaps once the change has landed, so a movement built on it happens after the change; this one happens with it.

Sensors#

NameTypeWhat it is
tilt_xnumberDevice tilt sideways in degrees (the roll angle). Absolute: it stays where the phone is held and never returns to the middle. Reading it turns on the rotation sensor, which costs battery. For depth effects use parallax_x.
tilt_ynumberDevice tilt forwards and backwards in degrees (the pitch angle). Absolute, like tilt_x.
compass_headingnumberCompass heading in degrees, 0–360.
parallax_xnumberSmoothed sideways tilt for depth, -1 to 1, positive when the right edge moves away from you. Measured against a reference that follows the phone, so holding it at an angle drifts back to 0 within a few seconds, and a phone lying still produces no frames at all. Turns on the gyroscope only while the home screen is visible.
lock_statenumberThe unlock transition: 0 while the lock screen is still showing, 1 once the home screen is at rest. After an unlock it springs from 0 to 1 and may overshoot a little; otherwise it stays at 1. Build your own unlock with it, for example a scale of $1 + (1 - lock_state) * 0.1$.
parallax_ynumberSmoothed forward and backward tilt for depth, -1 to 1, positive when the top edge moves away from you. Behaves like parallax_x.

Lists and scrubbing#

NameTypeWhat it is
scrub_posnumberInside a scrub repeater: position of this card relative to the finger, in cards (0 = under the finger). The wave in the alphabet index is built from it.
scrub_pressnumberInside a scrub repeater: 1 while the finger is down, 0 when it is not — animated, so it eases between the two.
scrub_visnumberInside a scrub repeater: 1 while the strip should be visible, 0 while it is hidden.
scrub_overnumberInside a scrub repeater: 1 for the card directly under the finger, 0 for all others.

Apps and profiles#

NameTypeWhat it is
app_nametextInside an app field: the app's display name.
app_packagetextInside an app field: the app's package name, e.g. "com.android.chrome".
app_profiletextInside an app field: which profile the app belongs to — "personal", "work" or "private".
app_badgenumberInside an app field: number of pending notifications for this app.
app_is_shortcutyes/noInside an app field: true when the entry is a pinned shortcut (a web app or bookmark added from a browser) instead of an installed app. Note that app_package then names the host app, so filter on this variable rather than on the package name.
work_profile_availableyes/noTrue when a work profile exists on this device.
work_profile_lockedyes/noTrue while the work profile is paused, so a theme can draw its own unlock row.
private_space_availableyes/noTrue when a Private Space exists on this device.
private_space_lockedyes/noTrue while the Private Space is locked.
private_space_hidden_when_lockedyes/noTrue when the user chose to hide the Private Space entirely while it is locked.
notification_accessyes/noTrue once the launcher has notification access. Draw your "grant access" hint behind a check on this, or it will never disappear.
notification_countnumberTotal number of pending notifications across all apps.

Weather#

NameTypeWhat it is
weather_tempnumberCurrent temperature in the unit set in the launcher's weather settings.
weather_emojitextA single emoji for the current conditions, e.g. "⛅".
weather_descriptiontextShort text for the current conditions, e.g. "light rain".
weather_location_nametextName of the place the weather is for.
weather_feels_likenumberApparent temperature.
weather_temp_minnumberToday's low.
weather_temp_maxnumberToday's high.
weather_humiditynumberRelative humidity in percent.
weather_pressurenumberAir pressure in hPa.
weather_wind_speednumberWind speed in the configured unit.
weather_wind_directionnumberWind direction in degrees, 0–360.
weather_wind_gustsnumberGust speed in the configured unit.
weather_cloud_covernumberCloud cover in percent.
weather_precipitationnumberPrecipitation amount.
weather_precip_probabilitynumberChance of precipitation in percent.
weather_uv_indexnumberUV index.
weather_sunrisetextLocal sunrise time as text, e.g. "06:41".
weather_sunsettextLocal sunset time as text.
weather_is_daynumber1 during daylight, 0 at night.
weather_aqinumberAir quality index.
weather_aqi_labeltextWord for the air quality index, e.g. "good".
weather_pm25numberFine particulate matter, PM2.5.
weather_pm10numberCoarse particulate matter, PM10.
NameTypeWhat it is
default_search_urltextURL template of the user's chosen search engine. Build a search box against this instead of hard-coding a provider.

Constants#

NameTypeWhat it is
pinumber3.14159…
enumber2.71828…

Documentation for launcher 0.1.0-alpha Android 12 and later last updated