okami.mom/glamour

git clone https://git.nkp.pet/okami.mom/glamour

bashbunnirefactor(gallery): use freeze for gallery images (#322)1fcce6f

main
751 B23 linesraw
1#!/bin/bash
2
3if ! command -v freeze &> /dev/null; then
4    echo "freeze not found. Please install freeze to capture images."
5    echo "https://github.com/charmbracelet/freeze/"
6    exit 1
7fi
8
9defaultStyles=("ascii" "auto" "dark" "dracula" "light" "notty" "pink")
10
11for style in "${defaultStyles[@]}"; do
12    echo "Generating screenshot for ${style}"
13    # take screenshot
14    if [[ $style == *"light"* ]]; then
15        # Provide a light background to images
16        freeze  -x "go run ./examples/artichokes ${style}" -b "#FAFAFA" -o "./styles/gallery/${style}.png"
17    else
18        freeze  -x "go run ./examples/artichokes ${style}" -o "./styles/gallery/${style}.png"
19    fi
20
21    # optimize filesize
22    pngcrush -ow "./styles/gallery/$style.png"
23done