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. |
| 11 | 11 | |
| 12 | 12 | * Unreleased |
| 13 | 13 | |
| 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 | |
| 14 | 21 | * 1.2.0 — 2026-09-04 |
| 15 | 22 | |
| 16 | 23 | ** Added |
README.md
+14 −3
| @@ -290,14 +290,25 @@ terminal-garden # your repos, as plants that grow and wilt |
| 290 | 290 | terminal-pet # the shell and the machine, as a mood |
| 291 | 291 | ``` |
| 292 | 292 | |
| 293 | | The third face lives in the menu bar. Launch `menubar-pet.app` from the |
| 294 | | Homebrew prefix, and add it under System Settings → General → Login Items to |
| 295 | | have it there every day: |
| 293 | The third face lives in the menu bar: |
| 296 | 294 | |
| 297 | 295 | ```sh |
| 298 | 296 | open "$(brew --prefix)/opt/ambient-companions/menubar-pet.app" |
| 299 | 297 | ``` |
| 300 | 298 | |
| 299 | To have it every day, install the LaunchAgent rather than adding a Login Item: |
| 300 | |
| 301 | ```sh |
| 302 | cp packaging/net.krz.ambient-companions.menubar-pet.plist ~/Library/LaunchAgents/ |
| 303 | launchctl load ~/Library/LaunchAgents/net.krz.ambient-companions.menubar-pet.plist |
| 304 | ``` |
| 305 | |
| 306 | A Login Item stores a *bookmark*, which macOS resolves to the versioned Cellar |
| 307 | path when you create it — so it breaks silently at the first `brew cleanup` |
| 308 | after 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 | |
| 301 | 312 | It has one life. Neglect it for a week — no typing, no commits — and it dies |
| 302 | 313 | for good, and the next one starts when you come back. |
| 303 | 314 | |
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> |