Ship a LaunchAgent for the menu-bar face !31

merged merged by cmc on 2026-09-04 17:40 UTC · krz/ambient-companions:docs/menubar-login into main

3 files changed, +53 −3

CHANGELOG.org +7
@@ -11,6 +11,13 @@ renumbered or removed.
1111
1212* Unreleased
1313
14** Added
15- =packaging/net.krz.ambient-companions.menubar-pet.plist=, a LaunchAgent for
16 the menu-bar face. A Login Item stores a bookmark that macOS resolves to the
17 versioned Cellar path at creation, so it breaks silently at the first
18 =brew cleanup= after an upgrade; launchd stores a string and follows the
19 =opt= symlink each time.
20
1421* 1.2.0 — 2026-09-04
1522
1623** Added
README.md +14 −3
@@ -290,14 +290,25 @@ terminal-garden # your repos, as plants that grow and wilt
290290terminal-pet # the shell and the machine, as a mood
291291```
292292
293The third face lives in the menu bar. Launch `menubar-pet.app` from the
294Homebrew prefix, and add it under System Settings → General → Login Items to
295have it there every day:
293The third face lives in the menu bar:
296294
297295```sh
298296open "$(brew --prefix)/opt/ambient-companions/menubar-pet.app"
299297```
300298
299To have it every day, install the LaunchAgent rather than adding a Login Item:
300
301```sh
302cp packaging/net.krz.ambient-companions.menubar-pet.plist ~/Library/LaunchAgents/
303launchctl load ~/Library/LaunchAgents/net.krz.ambient-companions.menubar-pet.plist
304```
305
306A Login Item stores a *bookmark*, which macOS resolves to the versioned Cellar
307path when you create it — so it breaks silently at the first `brew cleanup`
308after an upgrade. launchd stores the path as a string and follows Homebrew's
309`opt` symlink at each launch, so upgrades are invisible to it. There is no
310`KeepAlive`: the menu has a Quit item, and quitting should stick.
311
301312It has one life. Neglect it for a week — no typing, no commits — and it dies
302313for good, and the next one starts when you come back.
303314
packaging/net.krz.ambient-companions.menubar-pet.plist added +32
@@ -0,0 +1,32 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3<plist version="1.0">
4<dict>
5 <key>Label</key>
6 <string>net.krz.ambient-companions.menubar-pet</string>
7
8 <!--
9 Launches through Homebrew's version-independent opt symlink. A Login Item
10 stores a bookmark, which macOS resolves to the versioned Cellar path at the
11 moment it is created — so it breaks silently at the first brew cleanup
12 after an upgrade. launchd stores this as a literal string and follows the
13 symlink at each launch, so upgrades are invisible to it.
14 -->
15 <key>ProgramArguments</key>
16 <array>
17 <string>/opt/homebrew/opt/ambient-companions/menubar-pet.app/Contents/MacOS/menubar-pet</string>
18 </array>
19
20 <key>RunAtLoad</key>
21 <true/>
22
23 <!--
24 No KeepAlive on purpose: the menu has a Quit item, and KeepAlive would
25 relaunch the app the moment you used it.
26 -->
27
28 <!-- A GUI app: it needs the Aqua session to own a status item. -->
29 <key>LimitLoadToSessionType</key>
30 <string>Aqua</string>
31</dict>
32</plist>