0265afa054
Import the runnable game code, content, docs, scripts, and repo guidance while leaving local agent state, dependency installs, build output, and backup copies out of the published tree.
29 lines
776 B
Bash
29 lines
776 B
Bash
#!/usr/bin/env bash
|
|
# detect-viewer-backends.sh — Detect which VM viewer backends are available.
|
|
#
|
|
# Outputs a line for each detected backend: "vnc" or "spice"
|
|
# Used by DisplayAdapter.detect() to choose the right viewer at runtime.
|
|
#
|
|
# Exit code 0 always (even if nothing is found — caller handles empty output).
|
|
|
|
set -euo pipefail
|
|
|
|
# VNC viewers
|
|
if command -v virt-viewer &>/dev/null; then
|
|
echo "spice"
|
|
echo "vnc"
|
|
elif command -v remote-viewer &>/dev/null; then
|
|
echo "spice"
|
|
echo "vnc"
|
|
elif command -v xvncviewer &>/dev/null || command -v xtightvncviewer &>/dev/null || \
|
|
command -v vinagre &>/dev/null || command -v vncviewer &>/dev/null; then
|
|
echo "vnc"
|
|
fi
|
|
|
|
# SPICE standalone
|
|
if command -v spicy &>/dev/null; then
|
|
echo "spice"
|
|
fi
|
|
|
|
exit 0
|