Since: Version 20220807-113146-c2fee766
The functionality described in this section requires version 20220807-113146-c2fee766 of wezterm, or a more recent version.
For the date component of the time object, compute the times of the sun rise and sun set for the given latitude and longitude.
For the time component of the time object, compute whether the sun is currently up, and the progression of the sun through either the day or night.
Returns that information as a table:
The example above computes the information for Phoenix, Arizona at the time this documentation was being written.
The sun is presently up (
up == true) and is about 41%
progression=0.41843971631205673) of its way through the daylight portion of
If the sun would be down at the time portion of the time object, then
false and the
progression would indicate the proportion of the way through
This information is potentially useful if you want to vary color scheme or other configuration based on the time of day.
If the provided latitude and longitude specify a location at one of the poles,
then the day or night may be longer than 24 hours. In that case
set will be
progression will be
up will indicate if it is
polar daytime (
up==true) or polar night time (
up == false).