Copy the attached lua file to ~/.config/.rainlendar2/scripts/ and refresh Rainlendar. This is a standalone (and cut) version with sunrise and sunset only.
The file will create the alarm without the need for a window.
Well done! In the meanwhile I did a shorter version reusing globals functions.
The idea behind the script was to show the sunrise/sunset for the specified date, and not only the current date, that's why time1 changes everything.
At the end I will need it for all visible days. But, for now today is OK.
To avoid further problem, all the variables should be locals... but I leave that for you
And functions too!
I think that when 2 functions have the same name, the last win...
Noted the hard way:
-- Last definition always win if functions names collides:
-- First: Global folder for scripts: /usr/lib/rainlendar2/scripts/
-- Second: User folder for scripts: ~/.config/.rainlendar2/scripts/
-- Last: ~/.config/.rainlendar2/skins/Shadow4.r2skin/scripts/
With the added pitfall of required globals still not defined, but will go off when this be an addon.