From 665a56db000fc5921ef7593d8fef78de7b79024a Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Sat, 2 Dec 2023 14:45:47 -0600 Subject: Invert loop to accommodate screenshots. --- prepare | 46 +++++++++++++++++++++++++++++----------------- 1 file changed, 29 insertions(+), 17 deletions(-) diff --git a/prepare b/prepare index fa9e6ed..2d18fb0 100755 --- a/prepare +++ b/prepare @@ -211,24 +211,33 @@ size_only () from_y=$((${from}*${size#*:})); printf "Processing %s...\n" "${size}"; - for k in ${list}; do - x=$((${k}*${size%:*})); - y=$((${k}*${size#*:})); - printf " * Generating %4sx%4s (scale: %s)\n" "${x}" "${y}" "${k}"; - find "${data}" -mindepth 1 -maxdepth 1 -type d | sort | while read image; do - name=$(printf "%s\n" "${image}" | cut -d/ -f3); # sloppy, sorry - case "${name}" in - background|lockscreen) - type="png"; # override for quality - ;; - *) - type="${TYPE}"; - ;; - esac - printf " - '%s'\n" "${name}"; - mkdir -p "${KEEP}"/${name}; + + find "${data}" -mindepth 1 -maxdepth 1 -type d | sort | while read image; do + name=$(printf "%s\n" "${image}" | cut -d/ -f3); # sloppy, sorry + case "${name}" in + background|lockscreen) + type="png"; # override for quality + ;; + *) + type="${TYPE}"; + ;; + esac + printf " * %s\n" "${name}"; + mkdir -p "${KEEP}"/${name}; + + for k in ${list}; do + x=$((${k}*${size%:*})); + y=$((${k}*${size#*:})); + printf " - Generating %4sx%4s (scale: %s)\n" "${x}" "${y}" "${k}"; + + + # resized convert "${image}/${from_x}x${from_y}.png" -resize ${x}x${y}^ "${KEEP}"/${name}/${x}x${y}.${type}; done + + # screenshot + printf " - Generating screenshot\n"; + convert "${image}/${from_x}x${from_y}.png" -resize 400x250^ "${KEEP}"/${name}/screenshot.jpg; done } @@ -443,7 +452,10 @@ X-KDE-PluginInfo-License=CC-BY-SA-4.0 EOF # write metadata to 'gnome-background-properties/Adelie.xml' - find "${KEEP}"/${name}/contents/images -type f | grep -v metadata.desktop | sort | while read file; do + find "${KEEP}"/${name}/contents/images -type f \ + | grep -v metadata.desktop \ + | grep -v screenshot \ + | sort | while read file; do cat >> "${temp}" < ${description} -- cgit v1.2.3-70-g09d2