File: gallery.sh

package info (click to toggle)
golang-github-charmbracelet-glamour 0.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,064 kB
  • sloc: sh: 25; makefile: 6
file content (23 lines) | stat: -rwxr-xr-x 751 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

if ! command -v freeze &> /dev/null; then
    echo "freeze not found. Please install freeze to capture images."
    echo "https://github.com/charmbracelet/freeze/"
    exit 1
fi

defaultStyles=("ascii" "auto" "dark" "dracula" "light" "notty" "pink")

for style in "${defaultStyles[@]}"; do
    echo "Generating screenshot for ${style}"
    # take screenshot
    if [[ $style == *"light"* ]]; then
        # Provide a light background to images
        freeze  -x "go run ./examples/artichokes ${style}" -b "#FAFAFA" -o "./styles/gallery/${style}.png"
    else
        freeze  -x "go run ./examples/artichokes ${style}" -o "./styles/gallery/${style}.png"
    fi

    # optimize filesize
    pngcrush -ow "./styles/gallery/$style.png"
done