On Thu, 22 Feb 2024 14:03:24 -0500
Michael DeBusk via Remind-fans <[email protected]> wrote:

> A couple of days ago I started writing a bash script to put the
> current weather conditions into a notify-send popup and wanted a way
> to use different icons based on the conditions and whether or not it
> was day or night.

> ```
> BANNER %
> REM Sunrise: [sunrise()] Sunset: [sunset()]
> ```

Neat!  Another option is to do some of the logic in Remind itself.  For
example, if your icons are in separate directories "day" and "night",
your reminder file could look like this:

     # File day-or-night.rem
     BANNER %
     IF now() < sunrise() || now() > sunset()
         MSG night%
     ELSE
         MSG day%
     ENDIF

Then your Bash script could look like this:

ICONDIR=`remind day-or-night.rem`
# ...
ICON=$ICONDIR/$CONDITIONS

Regards,

Dianne.
_______________________________________________
Remind-fans mailing list
[email protected]
https://dianne.skoll.ca/mailman/listinfo/remind-fans
Remind is at https://dianne.skoll.ca/projects/remind/

Reply via email to