add file size next to the wallpeper name

This commit is contained in:
2025-07-10 12:43:10 +03:00
parent 4fb878d74f
commit 3be2579f3f
2 changed files with 135 additions and 131 deletions

View File

@@ -20,7 +20,7 @@ done
echo -e "\n---\n" >> "$OUT"
# Folders with images
# Folders with image entries
for dir in */; do
dir_name="${dir%/}"
anchor=$(printf '%s' "$dir_name" \
@@ -34,11 +34,15 @@ for dir in */; do
[ -f "$img" ] || continue
fn="$(basename "${img%.*}")"
rel="$(echo "$img" | sed 's|^\./||')"
echo "### ${fn}" >> "$OUT"
# Get filesize in human-readable format
size=$(du -h "$img" | cut -f1)
echo "### ${fn} — _${size}_ " >> "$OUT"
echo "" >> "$OUT"
echo "<img src=\"${rel}\" alt=\"${fn}\"/>" >> "$OUT"
echo "<img src=\"${rel}\" alt=\"${fn}\" />" >> "$OUT"
echo "" >> "$OUT"
done
echo "" >> "$OUT"
done