skeledance/set-sky-time.sh
vini 2ceb5df442 Grayish day sky, stronger fog clouds, sky clock jump control
Day sky desaturates to warm gray tones (matching the currently playing
album's cover), clouds get denser and larger so they actually read on
screen. New set-sky-time.sh + /tmp/skeledance-sky-offset poller jumps
the simulated sky clock to any time of today, composing with the
timelapse for previews.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015HtPHsTnDcLVSCiF5FGHZj
2026-07-19 21:42:12 -03:00

18 lines
623 B
Bash
Executable file

#!/usr/bin/env bash
# Pula o relógio do céu para hoje às HH:MM (ex.: ./set-sky-time.sh 06:15).
# "off" (ou sem argumento) volta ao tempo real. Combina com o timelapse.
STATE_FILE=/tmp/skeledance-sky-offset
TARGET=${1:-off}
if [ "$TARGET" = "off" ]; then
printf '0\n' > "$STATE_FILE"
printf 'Relógio do céu em tempo real\n'
exit 0
fi
target_epoch=$(date -d "today $TARGET" +%s) || exit 2
now_epoch=$(date +%s)
offset_h=$(awk "BEGIN { printf \"%.4f\", ($target_epoch - $now_epoch) / 3600 }")
printf '%s\n' "$offset_h" > "$STATE_FILE"
printf 'Relógio do céu em %s de hoje (offset %sh)\n' "$TARGET" "$offset_h"