From 2c8f190bf1e1981813cb04b75b80d46fa79263f5 Mon Sep 17 00:00:00 2001 From: Christopher Warner Date: Tue, 13 Oct 2026 15:12:17 -0400 Subject: feat: ship video install path for ThinkPad/Intel users Add install-aerial-videos, LocalSend lite video pack builder, Intel VAAPI preference, and software x265/x264 encode fallbacks so a T480 can install clips via zip or Apple fetch without AMD-specific assumptions. Co-authored-by: Cursor --- bin/install-aerial-videos | 94 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100755 bin/install-aerial-videos (limited to 'bin/install-aerial-videos') diff --git a/bin/install-aerial-videos b/bin/install-aerial-videos new file mode 100755 index 0000000..5e6b313 --- /dev/null +++ b/bin/install-aerial-videos @@ -0,0 +1,94 @@ +#!/usr/bin/env bash +# Install Aerial lite clips into ~/Videos/Screensavers/Aerial. +# +# Modes: +# install-aerial-videos # download from Apple + encode +# install-aerial-videos --from-zip FILE.zip # unpack a LocalSend video pack +# install-aerial-videos --from-dir DIR # copy already-lite .mp4 files +set -euo pipefail + +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +VIDEO_DIR="${VIDEO_DIR:-$HOME/Videos/Screensavers/Aerial}" +MODE="fetch" +FROM="" + +usage() { + cat <&2 + usage >&2 + exit 1 + ;; + esac +done + +mkdir -p "$VIDEO_DIR" + +case "$MODE" in + zip) + [[ -n "$FROM" && -f "$FROM" ]] || { echo "ZIP not found: $FROM" >&2; exit 1; } + echo "Installing videos from $FROM -> $VIDEO_DIR" + # Accept either flat mp4s or a single top-level folder of mp4s + tmp="$(mktemp -d)" + trap 'rm -rf "$tmp"' EXIT + unzip -q -o "$FROM" -d "$tmp" + mapfile -t files < <(find "$tmp" -type f \( -iname '*.mp4' -o -iname '*.mov' -o -iname '*.mkv' \) | sort) + if [[ ${#files[@]} -eq 0 ]]; then + echo "No videos inside zip" >&2 + exit 1 + fi + for f in "${files[@]}"; do + install -m 0644 "$f" "$VIDEO_DIR/$(basename "$f")" + done + echo "Installed ${#files[@]} clips ($(du -sh "$VIDEO_DIR" | cut -f1))" + ;; + dir) + [[ -n "$FROM" && -d "$FROM" ]] || { echo "DIR not found: $FROM" >&2; exit 1; } + echo "Copying videos from $FROM -> $VIDEO_DIR" + count=0 + while IFS= read -r -d '' f; do + install -m 0644 "$f" "$VIDEO_DIR/$(basename "$f")" + count=$((count + 1)) + done < <(find "$FROM" -maxdepth 1 -type f \( -iname '*.mp4' -o -iname '*.mov' -o -iname '*.mkv' \) -print0 | sort -z) + echo "Installed $count clips ($(du -sh "$VIDEO_DIR" | cut -f1))" + ;; + fetch) + need() { command -v "$1" >/dev/null 2>&1 || { echo "Missing dependency: $1" >&2; exit 1; }; } + need curl + need aria2c + need ffmpeg + FETCH="$ROOT/bin/fetch-aerial-recent" + [[ -x "$FETCH" ]] || FETCH="$(command -v fetch-aerial-recent)" + echo "Fetching + encoding recent Apple Aerial pack (needs network)..." + echo "On a ThinkPad T480 this can take a while; prefer --from-zip if you have the video pack." + DST_DIR="$VIDEO_DIR" "$FETCH" --encode + ;; +esac + +echo "Video dir: $VIDEO_DIR" +ls -lh "$VIDEO_DIR" -- cgit v1.2.3