summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2023-12-02 14:45:47 -0600
committerZach van Rijn <me@zv.io>2023-12-02 14:45:47 -0600
commit665a56db000fc5921ef7593d8fef78de7b79024a (patch)
tree299444d3570c52da3e8017096a19c7f5355f82f1
parent8fc3d32cb4ae9250498e0d157bf36981e259287c (diff)
downloadwallpapers-665a56db000fc5921ef7593d8fef78de7b79024a.tar.gz
wallpapers-665a56db000fc5921ef7593d8fef78de7b79024a.tar.bz2
wallpapers-665a56db000fc5921ef7593d8fef78de7b79024a.tar.xz
wallpapers-665a56db000fc5921ef7593d8fef78de7b79024a.zip
Invert loop to accommodate screenshots.
-rwxr-xr-xprepare46
1 files 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}" <<EOF
<wallpaper deleted="false">
<name>${description}</name>