diff options
author | Zach van Rijn <me@zv.io> | 2023-12-02 14:45:47 -0600 |
---|---|---|
committer | Zach van Rijn <me@zv.io> | 2023-12-02 14:45:47 -0600 |
commit | 665a56db000fc5921ef7593d8fef78de7b79024a (patch) | |
tree | 299444d3570c52da3e8017096a19c7f5355f82f1 | |
parent | 8fc3d32cb4ae9250498e0d157bf36981e259287c (diff) | |
download | wallpapers-665a56db000fc5921ef7593d8fef78de7b79024a.tar.gz wallpapers-665a56db000fc5921ef7593d8fef78de7b79024a.tar.bz2 wallpapers-665a56db000fc5921ef7593d8fef78de7b79024a.tar.xz wallpapers-665a56db000fc5921ef7593d8fef78de7b79024a.zip |
Invert loop to accommodate screenshots.
-rwxr-xr-x | prepare | 46 |
1 files changed, 29 insertions, 17 deletions
@@ -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}" <<EOF <wallpaper deleted="false"> <name>${description}</name> |