#!/bin/bash
# anolis:summary=Launch a TUI in the Anolis demo terminal
# anolis:args=[--app-id=<class>] <command> [args...]
set -euo pipefail
class=org.anolis.agent
if [[ ${1:-} == --app-id=* ]]; then class=${1#--app-id=}; shift; fi
(( $# )) || { echo 'A command is required' >&2; exit 2; }
[[ -n ${DISPLAY:-} ]] || { echo 'No graphical session; use anolis agent --inline from SSH.' >&2; exit 1; }
exec setsid xterm -class "$class" -name "$class" -title 'Anolis Agent' -fa 'DejaVu Sans Mono' -fs 12 -bg '#101b29' -fg '#d5e5f0' -cr '#83dbb3' -xrm '*utf8: 2' -xrm '*utf8Title: true' -e "$@"
