clawdie-iso/live/operator-session/clawdie-wallpaper-gen.sh

33 lines
1.1 KiB
Bash
Executable file

#!/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}"