Little Reminders Script

1337 h4x0r: nicholas LS whelan


A friend who enjoys cooking visited me recently. While she was here we did a lot of cooking together. It was the most fun I've had in the kitchen in a long time, and on reflection it occurred to me that it wasn't only because I'd been spending time with a friend. It was fun because I was doing something new. The experience made me realize I'd fallen into a rut in the kitchen. I had a menu of meals in my head that was diverse enough not to become obviously tedious, and easy enough to rotate through without thinking. That's a good thing to have when you're busy and need something hot to put on the table after a work day, but imperceptibly over time that approach had worn me down. Making food was just a chore, because there was never anything new. No room to grow.

I resolved to experiment in the kitchen more often. To find new recipes, learn new skills, cook and eat new things. The only trick was how to remember this resolution when it mattered. It's hard to know in advance when I'll have the time and energy to put together a more elaborate meal. The trick is to keep my desire present enough in my mind that I remember to take advantage of opportunities as they arise.

Hanging on my wall is a piece of paper from two years ago. On it is a list of Personal Goals:

  • Be more direct. Less passive aggressive.
  • Draft quickly.
  • Relax more often, and better.
  • Build social confidence.

Like my cooking resolution, all of these goals depend on remembering that I have these goals at times when I'm not thinking about self improvement. I've made progress on all these points over the past 2 years, but not nearly as much progress as I should have. And that lack of progress isn't because I fail, but merely because I so often forget to try! Hanging that paper on my wall hasn't been much of a help. It has become a fixture. I never stop to look at it.

What I need is some way for little reminders of these goals to impose themselves on me now and again. Just enough that they remain in somewhere in the mix of my thoughts. To fascilitate this, I wrote a little bash script for myself to pop reminders onto my desktop a couple times each week!


A popup window with a little heart icon sitting at the top of my screen. It reads: 1. Draft quickly. Iterate. 2. Don't pursue extended fantasies about invented conversations. In the background of the screenshot you can see the text file where I drafted this very post.

It's a simple little tool. Obviously I still need to put in the work, and take a greater responsibility for my own mindfulness, but this is one small way I'm making an effort at that.

For anyone curious, here's the bash code. (Written for Ubuntu 20.04, and working on 22.04):

get_reminder() {
 shuf -n 1 ~/bin/remind/reminders.txt
}
notify-send -u critical -t 0 -i ~/bin/remind/heart.ico "1. $(get_reminder)" $"\n2. $(get_reminder)"

You might note right away that the current version of the script doesn't prevent the same reminder from being grabbed twice. That's something I'd like to fix eventually. I also would have preferred to show 3 reminders, but notify-send is limited to two lines, so I settled for schedueling it to pop up twice a week, rather than once a week.

To ensure I don't miss it I set the priority of the message to critical, which keeps the notification on the screen until it is dismissed. By default, though, critical notifications appear with an icon that is meant to alarm the user. I didn't want to create any confusion between my goofy little script and an actually important system message, so I tossed a heart icon on it instead.

Using cron I've got it set up to run every Tuesday and Friday at 4am. The notification is waiting for me when I wake up, when I'm first putting my thoughts into order for the day. This was surprisingly the trickiest part of the job. Took me forever to learn that cron needs to be set with a special permission, "XDG_RUNTIME_DIR=/run/user/$(id -u)" before it can run any program that displays something onto the screen. At least I think that's why adding that bit fixed the problem. I'm not really confident in my understanding there.

I realize this script is a silly little digital potato, but I think it's neat. I even made a git hub repository for it.

—Nick LS Whelan

November 10, 2022