-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathgoose_gui
More file actions
executable file
·49 lines (39 loc) · 1.5 KB
/
goose_gui
File metadata and controls
executable file
·49 lines (39 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
# Goosetown GUI launcher wrapper
# Enables telepathy for the Goose desktop app when launched from terminal.
# Note: Telepathy only works when launched via this script, not from Finder/Spotlight/Dock.
#
# Keep this terminal open while using Goose. Press Ctrl+C to quit and clean up.
set -e
GOOSE_APP="/Applications/Goose.app"
if [[ ! -d "$GOOSE_APP" ]]; then
echo "Error: Goose.app not found at $GOOSE_APP" >&2
exit 1
fi
# Generate unique telepathy file for this session
TELEPATHY_FILE="/tmp/goose-telepathy-$$.txt"
touch "$TELEPATHY_FILE"
# Export for tom extension
export GOOSE_MOIM_MESSAGE_FILE="$TELEPATHY_FILE"
# Generate unique wall file for this session
WALLS_DIR="${HOME}/.goosetown/walls"
mkdir -p "$WALLS_DIR"
WALL_FILE="${WALLS_DIR}/wall-$$-${RANDOM}.log"
touch "$WALL_FILE"
export GOOSE_GTWALL_FILE="$WALL_FILE"
# Cleanup on exit
cleanup() {
rm -f "$TELEPATHY_FILE"
rm -f "$WALL_FILE"
rm -rf "${WALL_FILE%.log}.positions"
echo "Telepathy and wall files cleaned up." >&2
}
trap cleanup EXIT
echo "🦆 Goosetown GUI telepathy enabled: $TELEPATHY_FILE" >&2
echo "🦆 Goosetown GUI wall enabled: $WALL_FILE" >&2
echo "Keep this terminal open. Press Ctrl+C when done to clean up." >&2
# Launch GUI with -n to force new instance (ensures env var is picked up)
# Note: If Goose is already running, this creates a second instance
open -n -a "$GOOSE_APP" --args "$@"
# Block until user presses Ctrl+C (open doesn't create a child process we can wait on)
read -r -d '' _ 2>/dev/null