Greetings:

I can abuse remind, X-Windows, and cron to send timed messages to my XTerm.
I have a dated directory tree set up like this:
  $HOME/notebook/YYYY/MMDD/<files>

Example:

  $HOME
  +--notebook
  |   +--2026
  |   |   +--0220            <== today's sandbox.
  |   |   |   +--1325.rem
  |   |   |   ...
  |   |   |   +--Maildir
  |   |   |   |   +--cur
  |   |   |   |   |   +--msg1
  |   |   |   |   |   +--msg2 ...
  |   |   |   |   +--new
  |   |   |   |   +--tmp
  |
  |   |   +--0221            <== tomorrow's sandbox.
  ...

  me% cat ~/notebook/2026/0220/1325.rem
  REM MSG Wake up!

A cronjob runs every minute looking for a file named
  $HOME/notebook/YYYY/MMDD/HHMM.rem

So today at 1:25pm, this script will barf "Wake up!" all over my current
window, and it won't go away until I hit ENTER:

  #!/bin/bash

  file=$(date "+$HOME/notebook/%Y/%m%d/%H%M.rem")
  test -f "$file" || exit 0
  str=$(remind -h "$file" | sed -e '/^$/d' -e '/^Reminders/d')

  # I want a message about half the size of the current screen.

  H=600
  W=800

  set X $(xwininfo -root | sort |
      awk '
          /Height:/ { print int($2/2) }
          /Width:/  { print int($2/2) }
      ')

  case "$#" in
      3) H=$2; W=$3 ;;
      *) echo "xwininfo botch"; exit 1 ;;
  esac

  # Store the message with some Pango formatting to make it bigger.
  # I was using a "here" document, and there are differences between
  # KSH and Bash on how those are handled.

  msg="<span foreground=\"blue\" font=\"24\">

  $(date)

  ${str}
  </span>

  "

  # Yup, all this crap is for just one line.
  zenity --warning --no-wrap --width=$W --height=$H --text="$msg" &
  exit 0

One of many odd but useful things made possible by remind.

-- 
Karl Vogel                      I don't speak for anyone but myself

I know we can't put the cat back in the bag, but can we at least put the
cat in a toilet and sit on the lid while we flush it several times?
                            --Reddit comment about AI slop, 7 Feb 2026
_______________________________________________
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