feat(visuals): panel indicator + identity wallpaper + join-hive launcher

This commit is contained in:
Sam & Claude 2026-06-20 10:59:07 +02:00
parent 3c4d02a904
commit 1f7e94fa4c
6 changed files with 155 additions and 0 deletions

View file

@ -1606,6 +1606,16 @@ EOF
mkdir -p "${MOUNT_POINT}/usr/local/share/clawdie-iso" mkdir -p "${MOUNT_POINT}/usr/local/share/clawdie-iso"
install -m 0644 "${LIVE_SESSION_DIR}/START-HERE.txt" \ install -m 0644 "${LIVE_SESSION_DIR}/START-HERE.txt" \
"${MOUNT_POINT}/usr/local/share/clawdie-iso/START-HERE.txt" "${MOUNT_POINT}/usr/local/share/clawdie-iso/START-HERE.txt"
install -m 0755 "${LIVE_SESSION_DIR}/colibri-panel-indicator.sh" \
"${MOUNT_POINT}/usr/local/bin/colibri-panel-indicator"
install -m 0755 "${LIVE_SESSION_DIR}/clawdie-wallpaper-gen.sh" \
"${MOUNT_POINT}/usr/local/bin/clawdie-wallpaper-gen"
install -m 0755 "${LIVE_SESSION_DIR}/clawdie-join-hive.sh" \
"${MOUNT_POINT}/usr/local/bin/clawdie-join-hive"
install -m 0644 "${LIVE_SESSION_DIR}/clawdie-join-hive.desktop" \
"${MOUNT_POINT}/usr/local/share/applications/Clawdie Join Hive.desktop"
install -m 0644 "${LIVE_SESSION_DIR}/clawdie-join-hive.desktop" \
"${MOUNT_POINT}/home/clawdie/Desktop/Join Hive.desktop"
mkdir -p "${MOUNT_POINT}/usr/local/share/clawdie-iso/bootstrap" mkdir -p "${MOUNT_POINT}/usr/local/share/clawdie-iso/bootstrap"
install -m 0644 "${LIVE_SESSION_DIR}/bootstrap.html" \ install -m 0644 "${LIVE_SESSION_DIR}/bootstrap.html" \
"${MOUNT_POINT}/usr/local/share/clawdie-iso/bootstrap/index.html" "${MOUNT_POINT}/usr/local/share/clawdie-iso/bootstrap/index.html"

View file

@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
Version=1.0
Name=Join Hive
Comment=Register this machine as a Colibri agent
Exec=xfce4-terminal --title "Join Hive" --geometry=80x24 --command "/usr/local/bin/clawdie-join-hive.sh"
Icon=network-server
Terminal=false
Categories=System;Utility;

View file

@ -0,0 +1,70 @@
#!/bin/sh
# One-click "Join Hive" — registers this machine as a Colibri agent.
# Runs in a visible terminal so the operator sees the result.
# Idempotent: safe to re-run on an already-registered agent.
set -e
SOCKET="${COLIBRI_SOCKET:-/var/run/colibri/colibri.sock}"
PROVIDER_ENV="/usr/local/etc/colibri/provider.env"
echo "========================================"
echo " Clawdie — Join Hive"
echo "========================================"
echo ""
# 1. Check daemon
if [ ! -S "$SOCKET" ]; then
echo "[1/4] Starting colibri daemon..."
mdo -u root service colibri_daemon start
sleep 2
else
echo "[1/4] Daemon already running."
fi
# 2. Vault creds
echo "[2/4] Checking vault credentials..."
if [ -f "$PROVIDER_ENV" ] && grep -q 'BW_CLIENTID=.' "$PROVIDER_ENV" 2>/dev/null; then
echo " provider.env present with credentials."
else
echo " WARNING: provider.env missing or empty."
echo " Vault provisioning will be skipped."
echo " Edit ${PROVIDER_ENV} and re-run."
fi
# 3. Detect capabilities
HOST=$(hostname)
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
CAPS="$OS,shell"
# Add optional capabilities
which colibri >/dev/null 2>&1 && CAPS="$CAPS,colibri"
which hermes >/dev/null 2>&1 && CAPS="$CAPS,hermes"
which pi >/dev/null 2>&1 && CAPS="$CAPS,pi"
tailscale status >/dev/null 2>&1 && CAPS="$CAPS,tailscale"
[ "$OS" = "freebsd" ] && CAPS="$CAPS,rc.d,jail,zfs"
AGENT_NAME="${HOST}"
echo "[3/4] Registering agent: ${AGENT_NAME}"
echo " capabilities: ${CAPS}"
RESP=$(printf '{"cmd":"register-agent","name":"%s","capabilities":%s}\n' \
"$AGENT_NAME" "$(echo "$CAPS" | python3 -c "import sys; print(__import__('json').dumps(sys.stdin.read().strip().split(',')))")" \
| nc -U "$SOCKET" -w 3 2>/dev/null)
if echo "$RESP" | grep -q '"ok":true'; then
echo " registered."
elif echo "$RESP" | grep -q 'already exists'; then
echo " already registered (idempotent)."
else
echo " registration note: ${RESP}"
fi
# 4. Start poll loop
echo "[4/4] Agent ${AGENT_NAME} is live on the Colibri board."
echo ""
echo " Check: colibri status"
echo " Tasks: colibri list-tasks --status started"
echo " Board: colibri list-agents"
echo ""
echo "Hive joined. Press Enter to close."
read -r _

View file

@ -0,0 +1,33 @@
#!/bin/sh
# Generate a wallpaper with machine identity overlaid.
# Run once on first boot, caches result in /tmp/clawdie-wallpaper.png.
# Requires: ImageMagick (convert), tailscale, colibri socket.
set -e
OUT="${1:-/tmp/clawdie-wallpaper.png}"
BG="/usr/local/share/backgrounds/xfce/default.png"
HOST=$(hostname)
TS_IP=$(tailscale ip -4 2>/dev/null || echo "offline")
COLIBRI_SOCK="/var/run/colibri/colibri.sock"
COLIBRI_PORT="9190"
JAIL_RELEASE=$(freebsd-version 2>/dev/null || uname -r)
# Fall back to a solid colour if no background image exists
if [ ! -f "$BG" ]; then
convert -size 1920x1080 xc:'#1a1a2e' "$BG" 2>/dev/null || true
fi
# One-liner draw: place identity text in the bottom-left corner
convert "$BG" \
-font Helvetica -pointsize 18 -fill '#e0e0e0' \
-annotate +40+900 "hostname ${HOST}" \
-annotate +40+930 "tailscale ${TS_IP}" \
-annotate +40+960 "colibri ${COLIBRI_PORT}" \
-annotate +40+990 "jail ${JAIL_RELEASE}" \
-font Helvetica-Bold -pointsize 28 -fill '#8b5cf6' \
-annotate +40+850 "Clawdie OS" \
"$OUT"
echo "Wallpaper: ${OUT}"

View file

@ -0,0 +1,32 @@
#!/bin/sh
# xfce4-genmon panel indicator — polls colibri daemon health.
# Install: add a Generic Monitor panel item pointing to this script.
# Refresh interval: 30s.
#
# Output: green/red dot + agent count + task count.
# 🟢 2 agents · 3 tasks
# 🔴 daemon down
SOCKET="${COLIBRI_SOCKET:-/var/run/colibri/colibri.sock}"
TOOLTIP=""
if [ -S "$SOCKET" ]; then
STATUS=$(printf '{"cmd":"status"}\n' | nc -U "$SOCKET" -w 2 2>/dev/null)
if [ -n "$STATUS" ]; then
AGENTS=$(echo "$STATUS" | python3 -c "import sys,json; d=json.load(sys.stdin)['data']; print(d['agents'])" 2>/dev/null)
TASKS=$(echo "$STATUS" | python3 -c "import sys,json; d=json.load(sys.stdin)['data']; t=d['tasks']; print(t['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>"
TOOLTIP="Colibri: ${HOST} | socket: ${SOCKET} | agents: ${AGENTS} | started tasks: ${TASKS}"
else
echo "<txt>🔴 no response</txt>"
TOOLTIP="Colibri socket exists but not responding"
fi
else
echo "<txt>🔴 down</txt>"
TOOLTIP="Colibri daemon not running (no socket at ${SOCKET})"
fi
echo "<tool>${TOOLTIP}</tool>"
echo "<txtclick>xfce4-terminal --title 'Colibri Status' --command 'colibri status'</txtclick>"

View file

@ -54,3 +54,4 @@ xfce4-screenshooter-plugin
xfce4-taskmanager xfce4-taskmanager
ristretto ristretto
xfce4-tumbler xfce4-tumbler
ImageMagick7