<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title><![CDATA[Jake McCrary's articles on terminal-notifier]]></title>
  <link href="https://jakemccrary.com/atom.xml" rel="self"/>
  <link href="https://jakemccrary.com/"/>
  <updated>2026-03-14T17:06:03+00:00</updated>
  <id>https://jakemccrary.com/</id>
  <author>
    <name><![CDATA[Jake McCrary]]></name>
  </author>
  <entry>
    <id>https://jakemccrary.com/blog/notify-yourself-when-a-task-finishes/index.html</id>
    <link href="https://jakemccrary.com/blog/notify-yourself-when-a-task-finishes/index.html"/>
    <title><![CDATA[Notify yourself when a task finishes]]></title>
    <updated>2025-12-01T23:59:59+00:00</updated>
    <content type="html"><![CDATA[<div><p>If you&apos;ve got a ridiculously good memory and you&apos;ve been reading my writing for a while, you know I&apos;m a fan of processes <a href="/blog/categories/notifications/">notifying</a> you when they are done. I often have some task running in a hidden terminal that performs actions when files change. This is most often running Clojure tests whenever a file changes using either <a href="https://github.com/jakemcc/test-refresh">test-refresh</a> or <a href="https://github.com/jakemcc/lein-autoexpect">lein-autoexpect</a>. Another common watch task is rendering this website whenever one of the markdown files changes.</p><p>I don&apos;t like needing to have these processes always visible, since I mostly only care about when they finish. When running unit tests, I don&apos;t need to see the output unless a test is failing. When writing articles, I only care about when the rendering is done so I know I can refresh my browser to review the output.</p><p>On macOS, one way of doing this is using <a href="https://github.com/julienXX/terminal-notifier">terminal-notifier</a>. <code>terminal-notifier</code> makes it trivial to send notifications.</p><p>Below is the script I run while working on this website. It uses <code>entr</code> to monitor the input files; when changes are detected, it renders this site using my homegrown <a href="https://babashka.org/">Babashka</a> static site generator, and when that finishes, it uses <code>terminal-notifier</code> to alert me.</p><pre><code class="language-bash">#!/bin/bash
while sleep 0.5; do 
    rg bb templates source --files -t css -t clojure -t markdown -t html \
        | entr -d -s &apos;rm -rf output/*; bb render &amp;&amp; terminal-notifier -message &quot;Rendering complete&quot;&apos;;
done
</code></pre><p>This site renders quickly, so I can usually make some edits, save, and toggle to a browser to refresh and see the output. Still, it is nice to see that little notification pop-up on my screen so I know for sure that if I hit refresh, I&apos;m seeing the latest render.</p><p>When I&apos;m running my Clojure tests, both <code>lein-autoexpect</code> and <code>test-refresh</code> send a notification with a pass or fail message based on the status of the unit tests that just ran. If the tests are passing, I don&apos;t have to glance at my terminal. If they are failing, I do.</p><p>I&apos;d encourage you to think about what processes you might want to get notifications from when they are done and look into how to set that up. <code>terminal-notifier</code> works great on macOS. I can&apos;t make recommendations for other operating systems since it has been years since I&apos;ve used any alternatives besides SSHing into a Linux server.</p><p>It is worth the effort to figure out how to have notifications. They remove a trivial inconvenience (having to switch programs, needing to keep a window visible on your screen) and make life a little better. By stacking small, slightly life-improving techniques, all of a sudden you find yourself much more productive.</p></div>]]></content>
  </entry>
</feed>
