[Remind-Fans] New Remind helper script: remint - a Text UI for Remind

Gary Johnson garyjohn at spocom.com
Thu Sep 15 18:25:14 EDT 2022


On 2022-09-15, Mathieu via Remind-fans wrote:
> Thanks s lot, Dianne, and happy to see that it can be of any use for others!  
> 
> The ambition indeed is not to compete with Wyrd, I hope both tools can fill different niches. Here, the whole event editing is left to the text editor in the Remnind language. I simply wanted a minimal and rather portable viewer for Remind's nice text outputs, but with navigation/interaction features, a few toggles to customize the views, and seamless editing/refreshing. Bash is probably not the best for that but my skills are limited and I wanted no dependencies, since Wyrd is not easily installed on all distributions.
> 
> There's room for improvement but I want to keep it simple. I find it works best for me as a floating window when clicking on my clock.

Hi Mathieu,

That is very nice.  No more piping rem to less and not asking for
enough weeks or months.  Thank you.

I had a problem when I first tried to add a reminder, though:  vim
opened the current directory instead of the argument to remint.sh.
I took a look at the script and found a few issues.

- EDITOR is an environment variable set by users to tell programs
  what their preferred editor is.  It should not be altered as it is
  at line 36.

- On the help screen, the word "week" is missing its k.  (Line 75)

- When executing $EDITOR, vim and vi, the script has the editor jump
  to line 2 of $FILE.  That interferes with automatically jumping to
  the last cursor position, which I prefer for my reminders.

- When testing for the existence of a program, the script uses
  tests like this one for 'kak':

      if type "$(which kak)" > /dev/null; then

  Using 'which' here is redundant--'type' alone will do what you
  want.  Also, 'type' sends error messages to stderr, so that should
  be directed to /dev/null as well.  The test then becomes this:

      if type kak &> /dev/null; then

- Some comments state that you'd like to insert $REF
  programmatically.  For vim, you can do this (at line 257):

      vim -c "put ='$REF '" -c "startinsert!" "$FILE"

- Remind can use the environment variable DOTREMINDERS to find the
  reminders file if it not in the default place.  It would be nice
  if remint.sh used that as well.  I changed the code at line 435
  to this:

      if [[ -n "$DOTREMINDERS" ]] && [[ -e "$DOTREMINDERS" ]]; then
          INPUT="$DOTREMINDERS"
      elif [[ -e "$HOME/.config/remind/reminders" ]]; then

- I'm not sure what the difference is between INPUT and FILE, but
  FILE was not defined the first time I tried using the 'a' (add)
  command, so I added

      FILE=${1}"

  below line 466 (now line 468 in my modified copy).

- Every time the ui function finishes some command other than 'q',
  it calls itself again.  This puts another piece of information on
  bash's call stack.  For such a small script that is used briefly,
  then quit, this is probably not a problem, but it could be if
  someone just left it running.  I didn't change anything related to
  this.

I hope that's helpful.  I look forward to using remint.sh often.

Regards,
Gary



More information about the Remind-fans mailing list