feat(iso-visuals): out-of-box desktop experience — panel, wallpaper, join-hive

Three improvements for the Clawdie ISO first-boot desktop:

1. Panel health indicator (xfce4-genmon)
   - polls colibri socket every 30s
   - green/red dot + agent count + task count
   - click to open colibri status in terminal

2. Identity wallpaper generator
   - overlays hostname, Tailscale IP, Colibri port, FreeBSD release
   - runs on first boot, caches result
   - requires ImageMagick (add to ISO pkg list)

3. Join Hive launcher
   - one-click agent registration in visible terminal
   - checks daemon → vault creds → detect capabilities → register
   - idempotent, safe to re-run
   - pauses on result so operator reads before closing

All three scripts + skill.md + desktop entry in skills/iso-visuals/.
This commit is contained in:
Sam & Claude 2026-06-20 10:56:43 +02:00
parent 6f7fed3b50
commit fe328efb84
5 changed files with 271 additions and 0 deletions

127
skills/iso-visuals/SKILL.md Normal file
View file

@ -0,0 +1,127 @@
---
name: iso-visuals
description: Out-of-box visual experience for Clawdie ISO — panel health indicator, identity wallpaper, and one-click Join Hive launcher. Integrates into Xfce desktop on first boot.
triggers:
- "iso visuals"
- "out of box experience"
- "desktop wallpaper"
- "panel indicator"
- "join hive launcher"
- "first boot appearance"
- "clawdie desktop"
---
# ISO Visuals — Out-of-Box Desktop Experience
Three improvements that replace the "boot to a terminal" feeling with a calm,
informative desktop: a panel health indicator, a machine-identity wallpaper,
and a one-click Join Hive launcher.
## 1. Panel Health Indicator
Shows Colibri daemon status in the Xfce panel. Green/red dot with agent count.
Click to open a terminal with full `colibri status` output.
**Script:** `scripts/colibri-panel-indicator.sh`
**ISO integration:**
```bash
# Copy the script into the live filesystem
cp scripts/colibri-panel-indicator.sh /usr/local/bin/colibri-panel-indicator
chmod 755 /usr/local/bin/colibri-panel-indicator
# Add to Xfce panel via xfconf (or manually: Panel → Add New Items → Generic Monitor)
xfconf-query -c xfce4-panel -p /plugins/plugin-20 -n -t string -s genmon
xfconf-query -c xfce4-panel -p /plugins/plugin-20/command -n -t string -s /usr/local/bin/colibri-panel-indicator
```
The indicator polls every 30s, uses `<txt>`/`<tool>`/`<txtclick>` genmon markup.
Zero dependencies beyond `nc` and `python3` (both in the base jail bootstrap).
## 2. Identity Wallpaper
Generates a desktop background with machine identity overlaid:
hostname, Tailscale IP, Colibri port, and FreeBSD release.
**Script:** `scripts/clawdie-wallpaper-gen.sh`
**ISO integration:**
```bash
# Run on first boot, set as wallpaper
cp scripts/clawdie-wallpaper-gen.sh /usr/local/bin/clawdie-wallpaper-gen
chmod 755 /usr/local/bin/clawdie-wallpaper-gen
# In clawdie-bootstrap-launch.sh or xfce-session:
/usr/local/bin/clawdie-wallpaper-gen /usr/local/share/backgrounds/clawdie-default.png
# Set as wallpaper (Xfce):
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/workspace0/last-image \
-s /usr/local/share/backgrounds/clawdie-default.png
```
Requires ImageMagick (`pkg install ImageMagick` — add to ISO package list).
Falls back to a solid dark background if no default wallpaper exists.
**Format:**
```
┌────────────────────────────────────┐
│ │
│ Clawdie OS │
│ │
│ hostname osa │
│ tailscale 100.72.229.63 │
│ colibri 9190 │
│ jail 15.0-RELEASE-p4 │
│ │
└────────────────────────────────────┘
```
## 3. Join Hive Launcher
Desktop icon that runs the full agent registration flow in a visible terminal:
check daemon → verify vault creds → detect capabilities → register → done.
**Script:** `scripts/clawdie-join-hive.sh`
**Desktop entry:** `scripts/clawdie-join-hive.desktop`
**ISO integration:**
```bash
cp scripts/clawdie-join-hive.sh /usr/local/bin/clawdie-join-hive.sh
cp scripts/clawdie-join-hive.desktop /usr/local/share/applications/
cp scripts/clawdie-join-hive.desktop /home/clawdie/Desktop/
chmod 755 /usr/local/bin/clawdie-join-hive.sh
```
The launcher runs in `xfce4-terminal` with geometry 80x24, pauses on "Press Enter"
so the operator reads the result before the window closes.
**Idempotent** — safe to double-click multiple times. Already-registered agents
are detected and skipped.
## Build integration (clawdie-iso build.sh)
Add these lines to the ISO build script:
```bash
# --- ISO Visuals ---
install -m 755 scripts/colibri-panel-indicator.sh "${LIVE_ROOT}/usr/local/bin/colibri-panel-indicator"
install -m 755 scripts/clawdie-wallpaper-gen.sh "${LIVE_ROOT}/usr/local/bin/clawdie-wallpaper-gen"
install -m 755 scripts/clawdie-join-hive.sh "${LIVE_ROOT}/usr/local/bin/clawdie-join-hive"
install -m 644 scripts/clawdie-join-hive.desktop "${LIVE_ROOT}/usr/local/share/applications/"
install -m 644 scripts/clawdie-join-hive.desktop "${LIVE_ROOT}/home/clawdie/Desktop/"
```
And add `ImageMagick` to the ISO package list for the wallpaper generator.
## Verification
After booting the ISO:
1. **Panel:** green dot with agent count visible in the Xfce panel.
Clicking opens `colibri status` in a terminal.
2. **Wallpaper:** identity text in the bottom-left corner.
3. **Desktop:** "Join Hive" icon present. Double-click → terminal opens,
walks through registration, pauses for operator to read.

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>"