feat: enhance AI Workspace Menu Bar App with packaging scripts, login management, and service status improvements
This commit is contained in:
40
apps/mac/AIWorkspace/scripts/install-start-at-login.sh
Normal file
40
apps/mac/AIWorkspace/scripts/install-start-at-login.sh
Normal file
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
APP_PATH="${APP_PATH:-$HOME/Applications/AIWorkspace.app}"
|
||||
PLIST_PATH="$HOME/Library/LaunchAgents/com.aiworkspace.menu.plist"
|
||||
|
||||
if [[ ! -d "$APP_PATH" ]]; then
|
||||
echo "App not found: $APP_PATH" >&2
|
||||
echo "Run apps/mac/AIWorkspace/scripts/package-app.sh --install first." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$HOME/Library/LaunchAgents"
|
||||
|
||||
cat > "$PLIST_PATH" <<PLIST
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>com.aiworkspace.menu</string>
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<string>/usr/bin/open</string>
|
||||
<string>-a</string>
|
||||
<string>$APP_PATH</string>
|
||||
</array>
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<key>StandardOutPath</key>
|
||||
<string>$HOME/Library/Logs/AIWorkspace-menu.log</string>
|
||||
<key>StandardErrorPath</key>
|
||||
<string>$HOME/Library/Logs/AIWorkspace-menu.err.log</string>
|
||||
</dict>
|
||||
</plist>
|
||||
PLIST
|
||||
|
||||
launchctl unload "$PLIST_PATH" >/dev/null 2>&1 || true
|
||||
launchctl load "$PLIST_PATH"
|
||||
echo "Installed and loaded LaunchAgent: $PLIST_PATH"
|
||||
Reference in New Issue
Block a user