💾 Archived View for axionfield.space › gemlog › 20220512-remindme.gmi captured on 2023-03-20 at 17:41:03. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-06-03)

-=-=-=-=-=-=-

remindme

imgs/remindme.png

I was looking for a system to easily add reminders for various things from my

terminal. After looking around, I couldn't find anything that was suiting my

needs:

- Work from the terminal

- Use (idiotic) langage processing

- Store data in a file I can easily sync with Nextcloud or Syncthings

The best candidate I found was remind:

https://dianne.skoll.ca/wiki/Remind

It ticked almost all the boxes, was capable of handling insanely complex

scheduling, has been around for almost 30 years and is backed by simple text

files. The only missing thing was a tool to make it easy to to add reminders

using natural language.

This is where remindme enters the game:

https://git.sr.ht/~primalmotion/remindme

Now I could populate the REM files from invocations like:

remindme to get a coffee break in 5m
remindme to buy some milk next week
remindme to get leave for airport next tuesday at 9:00am

Running remind as a daemon is as simple as using the following systemd unit (or

whatever you use):

$ cat ~/.config/systemd/user/remind.service
[Unit]
Description=Reminders

[Service]
ExecStart=%h/.bin/remind.sh

[Install]
WantedBy=default.target

The content of remind.sh is straighforward:

$ cat ~/.bin/remind.sh
#!/bin/sh
FIFO="$HOME/.cache/fifo.remind"
rm "$FIFO"; mkfifo "$FIFO"
tail -f "$FIFO" | remind -z0 "-k$HOME/.bin/remind-notif.sh %s" "$HOME/.reminders"

(The -z0 option puts remind into listen mode so you can send commands through stdin.

remindme will send the REREAD command when it adds a reminder)

Here's the content of remind-notif.sh:

$ cat ~/.bin/remind-notif.sh
#!/bin/sh
notify-send -u critical -i "$HOME/.local/share/icons/remind.png" Reminders "$(date +%H:%M)\n$1"

(The -i option sets a path to the icon for the notification. You need to find

one, or just remove the -i option alltogether)

All can be done in the unit file, but the amount of needed bash escaping sauce

makes it disgusting.

Now you need to instruct remindme where to write the reminder and which named

pipe to poke to reload the remind state:

$ cat ~/.config/remindme/config.yaml
file: ~/.reminders/remindme.rem
pipe: ~/.cache/fifo.remind

Finally enable and start the service:

systemctl --user daemon-reload
systemctl enable --now remind

I'm using this system for a while now, and it works pretty well. I also

installed it on my Librem 5 so reminders are sync'ed between my laptop and my

phone. Take that, Cloud.