Subject: [GUIDE] Part 2: Automating a 400+ Logo HTML Gallery via Fastfetch & AhaBody:
IntroductionNow that
fastfetch is running natively, I wanted a way to catalog every built-in logo without manually running the command hundreds of times. This script creates a searchable, indexed HTML gallery that preserves terminal colors.
The "Saga" WorkflowTo get this working on a minimalist system like piCore, we need to pipe the raw terminal output through a "virtual terminal" to keep the colors, then convert those codes to HTML.
The Automation Script (ffa.sh)#!/bin/bashFastfetch Automation - Gallery GeneratorOUTPUT_FILE="fastfetch_master_gallery.html"Get the list of all logoslogos=$(./fastfetch --list-logos | head -n -5 | fmt -1 | tr -d '"' | sed '/^$/d')HTML Header with Dark Theme CSSecho "<html><head><style>body { background-color: #222d32; color: #fff; font-family: monospace; padding: 20px; }.nav { position: sticky; top: 0; background: #111; padding: 10px; border-bottom: 2px solid #333; }.logo-container { border-bottom: 1px solid #444; margin-bottom: 30px; }pre { background: #000; padding: 15px; overflow-x: auto; }</style></head><body>" > $OUTPUT_FILEecho "<div class='nav'><b>Fastfetch Logo Master List</b></div>" >> $OUTPUT_FILEThe Loop: Capture and Convertfor logo in $logos; doecho "Processing: $logo"echo "$logo</h2><pre>" >> $OUTPUT_FILE# Use 'script' to trick fastfetch into outputting colors, then pipe to 'aha'
script -q -c "./fastfetch --logo \"$logo\" --logo-type builtin" /dev/null | aha --black --no-header >> $OUTPUT_FILE
echo "</pre></div>" >> $OUTPUT_FILE
doneecho "</body></html>" >> $OUTPUT_FILEHosting the ResultOn the Pi 400, you can serve the file immediately to your network using Python:
python3 -m http.server 8081Then visit
http://<your-pi-ip>:8081 on any device.
Lessons Learned:Terminal Reset: If your SSH session text goes "staircase" mode after running, use the
stty sane command.
[]
Binary Paths: Since we are in the build folder, use
./fastfetch in the script to ensure it hits your fresh build.[/list]
Summary After successfully compiling
fastfetch natively (see Part 1), I moved into automating a master gallery of all 400+ logos. This post covers the "gotchas" of piCore persistence and the scripting required to capture ANSI colors in HTML.
1. The Capture Script (ffa.sh) To get a clean HTML gallery, we use
script to maintain the TTY colors and
aha to convert them.
Key command inside the script loop:
script -q -c "fastfetch --logo "$logo" --logo-type builtin" /dev/null | aha --black --no-header >> $OUTPUT_FILE 2. Solving the Backup "404" & Errors During the process of saving these tools, I encountered a few common piCore backup hurdles:
Wildcards: Do not use asterisks () in
.filetool.lst;
tar will fail to find the literal filename. []
Dead Links: If you have missing SSH keys or moved files in your list, the backup will abort. []
Broad Directories: Avoid adding
/usr/local or
/home directly to
.filetool.lst. This bloats the backup and can lead to failures. [/list]
3. Successful Persistence List For a clean backup that includes
fastfetch, your
/opt/.filetool.lst should look like this:
usr/local/bin/fastfetch usr/local/bin/aha home/tc/fastfetch/build/ffa.sh home/tc/fastfetch/build/fastfetch_master_gallery.html Run
filetool.sh -b and look for the "Done" message to ensure your work survives the next boot.