-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchode-start
More file actions
29 lines (26 loc) · 1.1 KB
/
Copy pathchode-start
File metadata and controls
29 lines (26 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
# chode-start — plays a splash video, fades to black, then launches Chad Code.
#
# Splash file resolution order:
# $CHODE_SPLASH → ~/.chode/splash.mp4 → ./splash.mp4 (next to this script)
# Skips silently if no video, no TTY, or no renderer is available.
#
# Renderers (best available wins):
# 1. chode_splash.py + ffmpeg — plays the video IN the terminal, with fade-out
# 2. mpv --vo=tct — mpv's own terminal video output
# 3. ffplay (GUI window) — plain fullscreen playback
set -u
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
SPLASH="${CHODE_SPLASH:-$HOME/.chode/splash.mp4}"
[ -f "$SPLASH" ] || SPLASH="$DIR/splash.mp4"
if [ -t 1 ] && [ -f "$SPLASH" ] && [ "${CHODE_NO_SPLASH:-}" != "1" ]; then
if command -v ffmpeg >/dev/null 2>&1; then
python3 "$DIR/chode_splash.py" "$SPLASH"
elif command -v mpv >/dev/null 2>&1; then
mpv --vo=tct --really-quiet --length=10 "$SPLASH" 2>/dev/null
clear
elif command -v ffplay >/dev/null 2>&1; then
ffplay -autoexit -fs -loglevel quiet "$SPLASH"
fi
fi
exec python3 "$DIR/chode.py" "$@"