Monorepo for Aesthetic.Computer aesthetic.computer
core toolchain macos
3 folders · 23 files

README.md

toolchain/macos #

Host-specific helpers that only make sense on a macOS machine.

sticky.mjs — the "sticky the X" workflow #

Drops text into a macOS Stickies note, styled the way @jeffrey likes it: translucent, larger text, sized to fit the content closely, and centered on screen.

When @jeffrey says "sticky the <thing>" on a macOS host, run this on that thing.

node toolchain/macos/sticky.mjs path/to/file.txt   # note from a file
node toolchain/macos/sticky.mjs --text "a note"    # note from a string
echo "a note" | node toolchain/macos/sticky.mjs    # note from stdin

Flags: --bigger N (font bumps over the Stickies default, default 3), --opaque (skip translucency), --no-center (leave it where it lands).

Needs Accessibility permission for the host terminal — the script drives Stickies with osascript / System Events keystrokes (⌘N, ⌘V, font bumps, ⌥⌘T). If the paste lands empty, the content is still on the clipboard; just ⌘V into the note by hand.

chrome-shot.mjs — safe headless Chrome screenshots #

Wraps Google Chrome --headless=new --screenshot=… so it actually exits. --headless=new reliably writes the PNG but often refuses to quit; left unattended these orphans pile up, each pinning a /tmp/chrome-* profile dir, and eventually open -a "Google Chrome" stops opening windows at all. This wrapper polls the output, kills Chrome the moment the file stabilises, cleans up the ephemeral profile, and reaps any headless Chromes older than 2 minutes before it starts.

node toolchain/macos/chrome-shot.mjs <url> <out.png> \
  [--size WxH] [--budget MS] [--wait MS] [--full-page]

Use this anywhere you'd otherwise type a raw Google Chrome --headless=new … incantation (TL site screenshots, paper previews, etc.). Never spawn a loose headless Chrome — always go through this script.

fleet_browser.py — one browser lifecycle per fleet Mac #

Ordinary browsing and CDP consumers use the same persistent Chrome profile. CDP consumers identify themselves as access-lease owners and share Chrome's consented DevToolsActivePort; the last release drops access without closing the browser. A launchd reaper removes abandoned owners. Acquiring refuses any competing unmanaged debug Chrome instead of creating another profile or port.

# Default: the persistent signed-in Profile 1, without acquiring automation access.
python3 toolchain/macos/fleet_browser.py open --url https://example.com

# Enable “Allow remote debugging” once at chrome://inspect/#remote-debugging,
# then acquire access only when a tool requires CDP.
python3 toolchain/macos/fleet_browser.py acquire --owner puppet-neo
python3 toolchain/macos/fleet_browser.py touch --owner puppet-neo
python3 toolchain/macos/fleet_browser.py release --owner puppet-neo

# Host health and abandoned-lease cleanup.
python3 toolchain/macos/fleet_browser.py status --json
python3 toolchain/macos/fleet_browser.py install-reaper --max-idle-minutes 30

The profile defaults to the ordinary Chrome root and Profile 1. Chrome owns the debugging port; consumers read it from DevToolsActivePort. Override the profile, expected account, and state directory with SLAB_BROWSER_CHROME_PROFILE, SLAB_BROWSER_EXPECTED_USER, and SLAB_BROWSER_STATE_DIR. Do not launch visible Chrome with an ad-hoc --user-data-dir; use a named access lease so ownership and cleanup remain visible.

Chrome DevTools MCP connections use toolchain/mcp/fleet-chrome-devtools.mjs. It acquires the same remote lease, owns its SSH tunnel, renews while alive, and releases both on exit:

node toolchain/mcp/fleet-chrome-devtools.mjs \
  --host=chicken --expected-user=jeffrey@fuser.studio

to-phone.mjs — push files to the iPhone (zero taps) #

Sends files from this Mac to @jeffrey's iPhone over the shared iCloud account (same Apple ID on both) — no AirDrop, no accept prompt, no drag. Two rails, auto-picked per file:

  • photos & videos → imported into Photos → iCloud Photos syncs them to the iPhone camera roll (ready to post to Instagram, etc.)
  • everything else → copied into iCloud Drive → shows up in the Files app
node toolchain/macos/to-phone.mjs <file...>
node toolchain/macos/to-phone.mjs --album "pals" *.png    # into a Photos album
node toolchain/macos/to-phone.mjs --drive report.pdf      # force iCloud Drive
node toolchain/macos/to-phone.mjs --folder pals doc.pdf   # Drive subfolder

Flags: --photos / --drive force a rail, --album NAME (Photos, created if missing), --folder NAME (iCloud Drive subfolder, default to-phone). Needs iCloud Photos + iCloud Drive on (both enabled on this host). Sync lands in a few seconds. Complements iphone-tap/ (which drives the phone via iPhone Mirroring) — this one gets files onto the phone.

gfn.sh — GeForce NOW network mode (Wi-Fi Macs) #

toolchain/macos/gfn.sh on pins the AWDL interface down (AirDrop/Handoff channel-hopping is the usual source of 20–100 ms spikes on a Wi-Fi hop) and turns AirDrop discoverability off for the session; off restores both; check prints Wi-Fi jitter plus GFN's own last network-test line. on installs a root LaunchDaemon (computer.aesthetic.gfn-awdl) that re-lowers awdl0 every 15 s, because macOS re-raises it on any Continuity touch; off removes it. Uses sudo on a TTY, or a macOS admin dialog when run from Claude's ! runner. Measured on blueberry: gateway hop stddev 23 ms → 3 ms. Tailscale stays up — with no exit node set, GFN traffic never touches it. A USB-C Ethernet adapter beats all of this.

gfn-window.sh — a GeForce NOW window that can get small #

The Mac client will not shrink below 900×600; the floor is a switch in the bundle's GeForceNOW.json, not a setting, and the command-line flag is ignored. toolchain/macos/gfn-window.sh shrink [W,H] lowers it (default 480×300), adds nv-sdl-force-windowed=true so the stream stays a window on the current Space, and relaunches; restore puts NVIDIA's file back from the one-time backup in ~/.config/gfn-window/. Self-contained — hand the file to any Mac GFN user. A GFN self-update rewrites the config, so re-run shrink if the floor returns. Slab's tiler (AXTiler.swift stage windows) then grids the stream beside the terminals.