Next Event

On your display
Displays the next event from multiple dates with a fully customizable countdown, display order, text, icon, and colors.
- Works with
- AWTRIX NG
- Topic
- Miscellaneous
- Includes
- Script
Choose your display in the next step.
Flow description
Next Event
Features
- Supports single dates and date ranges
- Automatically finds the next upcoming event
- Countdown in days or months
- Fully customizable display format
- Choose the order of description, text, number and unit
- Show only the countdown number if desired
- Customizable "In" and "Today" text
- Customizable singular and plural time units
- Customizable icon
- Normal and warning colors
- Configurable warning threshold
- Automatic updates every minute
Setup
Enter one or more dates in Event Dates.
Single date
24.12.2026
Date range
24.12.2026-31.12.2026
Multiple events
24.12.2026,31.12.2026,10.08.2027-01.09.2027
The script automatically selects the next upcoming event.
Display Order
Use Display Order to control exactly what is shown and in which order.
Available elements:
| Value | Description |
|---|---|
label |
Event description |
in |
Custom countdown text |
value |
Countdown number |
unit |
Time unit |
Separate elements with commas.
Examples
label,in,value,unit
Vacation in 12 days
label,value,unit
Vacation 12 days
value,unit
12 days
value
12
in,value
in 12
You can combine the elements in any order.
Custom Text
Description
The name of the event.
Default:
Event
Example:
Vacation
In
Text shown before the countdown.
Default:
in
Examples:
in
starts in
remaining
Today
Text shown when the event is today.
Default:
today!
Time Units
The countdown supports days and months.
All units can be customized.
| Setting | Default | German |
|---|---|---|
| Day (singular) | day |
Tag |
| Days (plural) | days |
Tagen |
| Month (singular) | month |
Monat |
| Months (plural) | months |
Monaten |
This makes the script suitable for different languages.
Warning
Set Warning Below to define when the warning color should be used.
For example:
Warning Below: 14
The countdown changes to the warning color when the event is 14 days or less away.
Icon
Enter an AWTRIX/LaMetric Icon ID.
Example:
12111
The icon is displayed on the left side of the countdown.
Colors
Normal Color
Used for the regular countdown.
Default:
#00AAFF
Warning Color
Used when the event is within the warning period.
Default:
#FF5500
Examples
Vacation
Event Dates: 10.08.2027-01.09.2027
Description: Vacation
Display Order: label,in,value,unit
→ Vacation in 324 days
Birthday
Description: Birthday
Display Order: label,value,unit
→ Birthday 42 days
Minimal Countdown
Display Order: value
→ 42
Use It For
Next Event is not limited to vacations. Use it for anything with a future date:
- Vacations
- Birthdays
- Holidays
- Trips
- Concerts
- Weddings
- Appointments
- Anniversaries
- Deadlines
- Other events
Configuration
| Setting | Default |
|---|---|
| Event Dates | 01.09.2027,... |
| Description | Event |
| Display Order | label,in,value,unit |
| In | in |
| Today | today! |
| Day (singular) | day |
| Days (plural) | days |
| Month (singular) | month |
| Months (plural) | months |
| Icon ID | 12111 |
| Normal Color | #00AAFF |
| Warning Color | #FF5500 |
| Warning Below | 14 |
8pdyRRZg0FGm.ax
# @name Next Event
# @desc Displays the next event from multiple dates
# @author m3m0rex
# @version 1.3
# @config dates text "Event Dates" default="01.09.2027,05.10.2030-09.10.2040" maxlen=256
# @config label text "Description" default="Event" maxlen=12
# @config order text "Display Order" default="label,in,value,unit" maxlen=64
# @config in text "In" default="in" maxlen=12
# @config today text "Today" default="today!" maxlen=12
# @config day text "Day (singular)" default="day" maxlen=12
# @config days text "Days (plural)" default="days" maxlen=12
# @config month text "Month (singular)" default="month" maxlen=12
# @config months text "Months (plural)" default="months" maxlen=12
# @config icon text "Icon ID" default="12111" maxlen=12
# @config normal color "Normal Color" default=#00AAFF
# @config warning color "Warning Color" default=#FF5500
# @config warningdays number "Warning Below" default=14 min=0 max=365 unit=Day
import string
class NextEvent
var dates
var label
var order
var in_text
var today_text
var day
var days_text
var month
var months
var icon_id
var normal
var warning
var warningdays
var next_start
var text_line
var color
var counter
def init()
self.dates=store.get("dates")
self.label=store.get("label")
self.order=store.get("order")
self.in_text=store.get("in")
self.today_text=store.get("today")
self.day=store.get("day")
self.days_text=store.get("days")
self.month=store.get("month")
self.months=store.get("months")
self.icon_id=store.get("icon")
self.normal=store.get("normal")
self.warning=store.get("warning")
self.warningdays=store.get("warningdays")
self.color=self.normal
self.counter=0
self.find_next()
end
def dn(y,m,d)
if m<=2
y-=1
end
var e=y/400
var yoe=y-e*400
var mp=m>2 ? m-3 : m+9
var doy=(153*mp+2)/5+d-1
return e*146097+yoe*365+yoe/4-yoe/100+doy
end
def pd(s)
var p=string.split(s,".")
if size(p)!=3
return nil
end
return self.dn(int(p[2]),int(p[1]),int(p[0]))
end
def pe(e,t)
var p=string.split(e,"-")
var s=nil
var f=nil
if size(p)==2
s=self.pd(p[0])
f=self.pd(p[1])
elif size(p)==1
s=self.pd(p[0])
f=s
end
if s!=nil && f!=nil && f>=t
if self.next_start==nil || s<self.next_start
self.next_start=s
end
end
end
def build(v,u)
var r=""
var p=string.split(self.order,",")
for x:p
var a=""
if x=="label"
a=self.label
elif x=="in"
a=self.in_text
elif x=="value"
a=str(v)
elif x=="unit"
a=u
end
if a!=""
if r!=""
r+=" "
end
r+=a
end
end
return r
end
def find_next()
var t=self.dn(year(),month(),day())
self.next_start=nil
var es=string.split(self.dates,",")
for e:es
self.pe(e,t)
end
if self.next_start==nil
self.text_line="No event"
self.color=self.normal
return
end
var d=self.next_start-t
if d==0
self.text_line=self.label+" "+self.today_text
self.color=self.warning
elif d<30
self.text_line=self.build(d,d==1 ? self.day : self.days_text)
self.color=d<=self.warningdays ? self.warning : self.normal
else
var m=d/30
self.text_line=self.build(m,m==1 ? self.month : self.months)
self.color=self.normal
end
end
def loop()
self.counter+=1
if self.counter>=60
self.counter=0
self.find_next()
end
end
def draw()
clear()
if !icon(self.icon_id,0,0)
rect_fill(0,0,8,8,0x222222)
end
scroll_text(9,6,width()-9,self.text_line,self.color)
end
end
return NextEvent()
Discussion 0
Ask a question, suggest a change or share how you use it.
No comments yet. Start the conversation.
More flows for AWTRIX NG Scripts or Miscellaneous
Something wrong with this flow? Report it.
Have an idea?
Sign in to ask questions and join the conversation.