Files
2026-05-16 19:24:30 -05:00

26 lines
446 B
Bash

#!/usr/bin/env bash
set -euo pipefail
DEVICE="${KMSCUBE_DRM_DEVICE:-/dev/dri/card0}"
if ! command -v kmscube >/dev/null 2>&1; then
echo "kmscube is not installed" >&2
exit 127
fi
if [ ! -e "$DEVICE" ]; then
for candidate in /dev/dri/card*; do
if [ -e "$candidate" ]; then
DEVICE="$candidate"
break
fi
done
fi
if [ ! -e "$DEVICE" ]; then
echo "No DRM card device found" >&2
exit 1
fi
exec kmscube -D "$DEVICE"