← back to Dot Palette
start.command
21 lines
#!/bin/zsh
# Launch the always-on-top dot palette. Reuses desktop-dotbar's Electron runtime
# so there is nothing to npm-install. Double-click this file, or run it from a shell.
cd "$(dirname "$0")"
ELECTRON="$HOME/Projects/desktop-dotbar/node_modules/.bin/electron"
if [[ ! -x "$ELECTRON" ]]; then
echo "Electron not found at $ELECTRON — run 'npm i' in ~/Projects/desktop-dotbar first." >&2
exit 1
fi
# Single instance: if a palette is already up, don't stack another.
if pgrep -f "dot-palette/electron-main.js" >/dev/null 2>&1; then
echo "dot-palette already running."
exit 0
fi
# Enforce production isolation: server.js's test seams (used only by selftest.js /
# screenrecord --isolated) are child-inherited env vars. Clearing them here makes
# "the seams are inert in production" a CODE-enforced fact, not a convention — a stray
# seam left in Steve's shell can never leak in to mock the engine or mis-target a tty.
unset DOTPALETTE_ENGINE DOTPALETTE_ENGINE_BIN DOTPALETTE_TTY_OVERRIDE DOTPALETTE_PORT_FILE
exec "$ELECTRON" . >/tmp/dot-palette.log 2>&1