feat: add bohm-side deploy wrappers for inky-tasks

This commit is contained in:
Padreug 2026-05-16 14:09:23 +02:00
commit 47e328f651
2 changed files with 40 additions and 0 deletions

22
push-to-inky.sh Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
if [[ $# -ne 1 ]]; then
echo "usage: $0 <image>" >&2
exit 1
fi
INPUT="$1"
NAME="$(basename "$INPUT")"
ROTATED="$(mktemp --suffix="-${NAME}")"
trap 'rm -f "$ROTATED"' EXIT
.venv/bin/python3 - "$INPUT" "$ROTATED" <<'PY'
import sys
from PIL import Image
Image.open(sys.argv[1]).rotate(90, expand=True).save(sys.argv[2])
PY
rsync -v "$ROTATED" "inky-tasks:InkyImages/${NAME}"
ssh inky-tasks "~/.virtualenvs/pimoroni/bin/python ~/inky/examples/spectra6/image.py --file ~/InkyImages/${NAME}"

18
run-inky-today.sh Executable file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")"
PUSH=1
if [[ "${1-}" == "--no-push" ]]; then
PUSH=0
shift
fi
OUT="${1:-inky_today.png}"
./.venv/bin/python inky_today.py "$OUT" --no-push
if (( PUSH )); then
./push-to-inky.sh "$OUT"
fi