clawdie-iso/live/operator-session/colibri-panel-indicator.sh
Sam & Claude b4c86b68f4 feat(iso): replace xfce4-terminal with kitty
Kitty: GPU-accelerated, keyboard-driven, respects terminal color themes,
supports modern escape codes ratatui uses (REVERSED, italic, true color).

Changes:
- pkg-list-xfce.txt: kitty replaces xfce4-terminal
- 3 desktop launchers: Exec=kitty with -T (title) + -o window size
- Panel indicator: kitty for colibri status
- Session rescue: kitty for desktop rescue terminal
- Panel config: kitty.desktop in launcher-4
- BUILD.md: docs updated
2026-06-25 20:03:39 +02:00

39 lines
1.5 KiB
Bash
Executable file

#!/bin/sh
# xfce4-genmon panel indicator — polls colibri daemon health.
# Wired into a Generic Monitor panel item with 30s refresh.
# Output: genmon XML with green/red dot + agent count + task count.
# 🟢 2 agents · 3 tasks
# 🔴 daemon down
SOCKET="${COLIBRI_SOCKET:-/var/run/colibri/colibri.sock}"
have() {
command -v "$1" >/dev/null 2>&1
}
if ! have nc || ! have python3; then
echo "<txt>⚠ missing deps</txt>"
echo "<tool>nc and python3 required for colibri panel indicator</tool>"
exit 0
fi
if [ ! -S "$SOCKET" ]; then
echo "<txt>🔴 down</txt>"
echo "<tool>Colibri daemon not running (no socket at ${SOCKET})</tool>"
exit 0
fi
STATUS=$(printf '{"cmd":"status"}\n' | nc -U "$SOCKET" -w 2 2>/dev/null)
if [ -z "$STATUS" ]; then
echo "<txt>🔴 no response</txt>"
echo "<tool>Colibri socket exists but not responding</tool>"
exit 0
fi
AGENTS=$(echo "$STATUS" | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['agents'])" 2>/dev/null)
TASKS=$(echo "$STATUS" | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['tasks']['started'])" 2>/dev/null)
HOST=$(echo "$STATUS" | python3 -c "import sys,json; print(json.load(sys.stdin)['data']['host'])" 2>/dev/null)
echo "<txt>🟢 ${AGENTS:-?} agents · ${TASKS:-?} tasks</txt>"
echo "<tool>Colibri: ${HOST:-?} | socket: ${SOCKET} | agents: ${AGENTS:-?} | started tasks: ${TASKS:-?}</tool>"
echo "<txtclick>kitty -T 'Colibri Status' colibri status</txtclick>"