From 8fc3d32cb4ae9250498e0d157bf36981e259287c Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Sat, 2 Dec 2023 14:28:59 -0600 Subject: Initial commit. --- .gitignore | 4 + README | 64 ++++++ prepare | 483 ++++++++++++++++++++++++++++++++++++++++++++ src/artisan/MANIFEST | 2 + src/artisan/image.jpg | Bin 0 -> 1601812 bytes src/autumn-leaves/MANIFEST | 2 + src/autumn-leaves/image.jpg | Bin 0 -> 5813930 bytes src/cloudy-sky/MANIFEST | 2 + src/cloudy-sky/image.jpg | Bin 0 -> 1762320 bytes src/contentment/MANIFEST | 2 + src/contentment/image.jpg | Bin 0 -> 1172765 bytes src/ferris-wheel/MANIFEST | 2 + src/ferris-wheel/image.jpg | Bin 0 -> 1063068 bytes src/floral/MANIFEST | 2 + src/floral/image.jpg | Bin 0 -> 1218275 bytes src/harbour/MANIFEST | 2 + src/harbour/image.jpg | Bin 0 -> 2259110 bytes src/modern-motion/MANIFEST | 2 + src/modern-motion/image.jpg | Bin 0 -> 1421942 bytes src/moon/MANIFEST | 2 + src/moon/image.jpg | Bin 0 -> 1537702 bytes src/sunset/MANIFEST | 2 + src/sunset/image.jpg | Bin 0 -> 1141196 bytes src/theseus/MANIFEST | 2 + src/theseus/image.jpg | Bin 0 -> 1117401 bytes 25 files changed, 573 insertions(+) create mode 100644 .gitignore create mode 100644 README create mode 100755 prepare create mode 100644 src/artisan/MANIFEST create mode 100644 src/artisan/image.jpg create mode 100644 src/autumn-leaves/MANIFEST create mode 100644 src/autumn-leaves/image.jpg create mode 100644 src/cloudy-sky/MANIFEST create mode 100644 src/cloudy-sky/image.jpg create mode 100644 src/contentment/MANIFEST create mode 100644 src/contentment/image.jpg create mode 100644 src/ferris-wheel/MANIFEST create mode 100644 src/ferris-wheel/image.jpg create mode 100644 src/floral/MANIFEST create mode 100644 src/floral/image.jpg create mode 100644 src/harbour/MANIFEST create mode 100644 src/harbour/image.jpg create mode 100644 src/modern-motion/MANIFEST create mode 100644 src/modern-motion/image.jpg create mode 100644 src/moon/MANIFEST create mode 100644 src/moon/image.jpg create mode 100644 src/sunset/MANIFEST create mode 100644 src/sunset/image.jpg create mode 100644 src/theseus/MANIFEST create mode 100644 src/theseus/image.jpg diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..de54eb5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.DS_Store +adelie-wallpapers-*.tar.xz +build/ +output/ diff --git a/README b/README new file mode 100644 index 0000000..669925c --- /dev/null +++ b/README @@ -0,0 +1,64 @@ +overview +-------- + +This is the Adélie Wallpapers repository. It contains +the original source images, metadata, and brand assets +to generate wallpapers for the Adélie Linux distribution. + + +structure +--------- + +The only choices a contributor has are '' and +''. All other variables are in 'MANIFEST'. + + / <-- this repository + // <-- image name slug + /image. <-- image file + /MANIFEST <-- metadata file + /prepare <-- generator script + + +building +-------- + +(1) ensure that you have cloned the full repository + +(2) ensure that you are checked out at a tag that has + been pushed to origin + +(3) run the 'prepare' script with no arguments + +(4) upload the resulting tarball, in 'output/', to the + distfiles mirror, directly under 'source/' + + +contributing +------------ + +You must agree to license your contributions in a manner +consistent with the license of this repository. + +Follow the structure specified above. Examples abound. + + +license +------- + +All images in this repository are distributed under the +Creative Commons Attribution Share-Alike (CC BY-SA) 4.0 +license, a copy of which may be found here: + + https://creativecommons.org/licenses/by-sa/4.0/ + +This covers the output tarball and its contents. + +The 'prepare' script is distributed under the Apache 2.0 +license, and is not included in the output tarball. + +The GitLab project repository icon is from here: + + https://www.iconfinder.com/icons/2499015/background_image_landscape_laptop_wallpaper_icon + https://creativestall.com/ + +We consider it Fair Use for illustrative purposes. diff --git a/prepare b/prepare new file mode 100755 index 0000000..fa9e6ed --- /dev/null +++ b/prepare @@ -0,0 +1,483 @@ +#!/bin/sh -e + +#=============================================================== +# Filename : prepare +# Purpose : Prepare wallpapers for Adélie desktop environments. +# Authors : Zach van Rijn +# License : Apache 2.0 +# Revision : 20231202 +#=============================================================== + +#=============================================================== +# README +#=============================================================== + +## +# This script transforms source images, including Adélie logos, +# into a set of wallpapers suitable for packaging. +# +# There are two distinct output products: +# +# (1) a "core" or "slim" bundle, containing a lightweight set of +# default wallpaper(s) and/or branding; and +# +# (2) a "full" bundle containing all available wallpapers, which +# is suitable for use when disk space isn't a major concern. +# +# +# +# requirements +# ------------ +# +# * imagemagick +# +# +# usage +# ----- +# +# To process all source images and generate a tarball for upload +# to 'distfiles', simply run the following command: +# +# $ ./prepare +# +# Any tarball of the same name will be silently overwritten. +# + + +#--------------------------------------------------------------- +# configuration: source image input +#--------------------------------------------------------------- + +## +# Distfiles mirror. +# +HOST="https://distfiles.adelielinux.org"; + + +## +# Adélie brand asset bundle version. +# +# This corresponds to the commit of 'adelie/site-ng' from which +# the brand assets were generated. A tarball matching this hash +# must exist in the '/source/site-ng-images/' directory. +# +# See https://git.adelielinux.org/adelie/site-ng for details. +# +HASH=ca57e2bd46f11bf2efdebbca8c7813235744fd5f; + + +## +# Name of the containing directory and tarball on distfiles. +# +NAME="site-ng-images"; + + +#--------------------------------------------------------------- +# configuration: processed image output +#--------------------------------------------------------------- + +## +# Name of output directory. Please ensure it is in '.gitignore'. +# +KEEP="output"; + + +## +# Choose an output file type. +# +TYPE="jpg"; + + +## +# Table of aspect ratios to generate wallpapers for. +# +# Format: RATIO SCALE [SCALE ...] +# +# Scale is distributed, e.g.: +# +# "4:3 640" --> (640*4)x(640*3) = 2560x1920 +# +# Note that many popular aspect ratios are approximate. We are +# only concerned with getting to the right ballpark. +# +# Table rows MUST BE SORTED FROM GREATEST TO LEAST. +# +MAKE=$(grep -v ^# <&1 >/dev/null; then + printf "E: required utility '%s' not found!\n" "${k}"; + exit 1; + fi +done + + +## +# Tag first, then generate release the tarball. Sanity checks do +# not prevent someone from being stupid, but they can avoid some +# common errors. We want to reduce surprises/ensure consistency. +# +VTAG=$(git describe --abbrev=0 2>/dev/null || true); +if test -z "${VTAG}"; then + printf "E: you need to tag at least one commit!\n"; + exit 1; +fi +if test $(git rev-list ${VTAG}..HEAD | wc -l) -gt 0; then + printf "E: you need to be checked out at a tag!\n"; + exit 1; +fi +if test $(git ls-remote --tags origin ${VTAG} | wc -l) -eq 0; then + printf "E: tag '%s' does not exist on origin!\n" "${VTAG}"; + exit 1; +fi + + +## +# Name of build directory. Please ensure it is in '.gitignore'. +# +TEMP="build"; + + +## +# Name of source directory. +# +IMGS="src"; + + +## +# Ensure that no images have conflicting names. +# +# FIXME: factor out 'background lockscreen' here and elsewhere. +# +for k in background lockscreen; do + if test -d "${IMGS}"/${k}; then + printf "E: not allowed to name image '%s'!\n" "${k}"; + exit 1; + fi +done + + +#--------------------------------------------------------------- +# internal: support routines +#--------------------------------------------------------------- + +## +# size_only DIR RATIO SCALE [SCALE ...] +# +size_only () +{ + data="${1}"; shift; + size="${1}"; shift; + from="${1}"; # NO SHIFT + list="${@}"; + + ## + # FIXME: assumes 'a:b' where 'a' and 'b' are integers. This + # should check that this actually holds. + # + case "${size}" in + *:*) + ;; + *) + printf "E: invalid aspect ratio '%s'!\n" "${size}"; + exit 1; + ;; + esac + + ## + # Generated images have known sizes that do not change. + # + from_x=$((${from}*${size%:*})); + 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}; + convert "${image}/${from_x}x${from_y}.png" -resize ${x}x${y}^ "${KEEP}"/${name}/${x}x${y}.${type}; + done + done +} + +#--------------------------------------------------------------- +# internal: core +#--------------------------------------------------------------- + +mkdir -p "${HERE}/${TEMP}"; +mkdir -p "${HERE}/${KEEP}"; + +## +# Fetch the specified brand asset bundle from distfiles. +# +# TODO: error checking, return codes etc. +# +( + cd "${TEMP}"; + + if ! test -e ${NAME}-${HASH}.tar.gz; then + curl -O "${HOST}"/source/${NAME}/${NAME}-${HASH}.tar.gz; + fi + + tar -xf ${NAME}-${HASH}.tar.gz; +) + + +#--------------------------------------------------------------- +# internal: generate minimal wallpapers +#--------------------------------------------------------------- + +## +# The default "core" or "slim" wallpaper is made on the fly and +# not provided as a rasterized image from the start. +# + +## +# make_fake GRADIENT_FROM GRADIENT_TO XxY TEMPLATE OUTPUT +# +make_fake () +{ + size="${1}"; shift; # geometry + hexa="${1}"; shift; # gradient from + hexb="${1}"; shift; # gradient to + temp="${1}"; shift; # template + name="${1}"; shift; # output filename + + printf "Generating %5s ('%s')...\n" "${size}" "${name}"; + magick \ + -define gradient:angle=65 \ + -size ${size} \ + gradient:"${hexa}"-"${hexb}" \ + "${name}" \ + ; + + # FIXME: this is literal magic? + composite \ + -compose atop \ + -gravity southwest \ + -background none \ + "${TEMP}"/polyguin.svg \ + "${name}" \ + "${name}" \ + ; + composite \ + -compose atop \ + -gravity southeast \ + -background none \ + "${TEMP}"/gen_polylogo_template_${temp}.png \ + -geometry +50+20 \ + "${name}" \ + "${name}" \ + ; +} + + +## +# Generate starting templates. That is, generate the largest one +# possible for each aspect ratio. +# +printf "%s\n" "${MAKE}" | while read ratio scale _; do + # compute largest required + x=$((${scale}*${ratio%:*})); + y=$((${scale}*${ratio#*:})); + + ############################################################ + # FIXME! + # FOR SOME REASON, CHANGING '#EEEEEF' TO '#EEEEEE' OR FROM + # '#303031' TO '#303030' WILL DISCARD COLOR INFORMATION OF + # THE COMPOSITED SVG. WTF. WE LEVERAGE THIS THOUGH... + ############################################################ + + # background (we want the buggy black/white version) + mkdir -p "${TEMP}"/generated/background; + make_fake ${x}x${y} "#bbbbbb" "#eeeeee" black_x200 "${TEMP}"/generated/background/${x}x${y}.png; + #make_fake ${x}x${y} "#bbbbbb" "#eeeeef" black_x200 "${TEMP}"/generated/background/${x}x${y}.png; + + # lockscreen (we want the color version) + mkdir -p "${TEMP}"/generated/lockscreen; + #make_fake ${x}x${y} "#151515" "#303030" white_x200 "${TEMP}"/generated/lockscreen/${x}x${y}.png; + make_fake ${x}x${y} "#151515" "#303031" white_x200 "${TEMP}"/generated/lockscreen/${x}x${y}.png; +done + + +#--------------------------------------------------------------- +# internal: scale all wallpapers +#--------------------------------------------------------------- + +## +# To generate "real" wallpapers, we simply resize them. This can +# be be improved significantly, but that is a future problem. +# +make_real () +{ + size="${1}"; shift; # geometry + temp="${1}"; shift; # template + name="${1}"; shift; # output filename + + # TODO: add filename extension checker? + + printf "Generating %5s ('%s')...\n" "${size}" "${name}"; + convert "${file}" -resize ${size}^ "${name}"; +} + + +## +# Source images may not all be consistent in their aspect ratios +# or dimensions. We will scale (crop) source images to match the +# sizes of the generated core templates. +# +printf "%s\n" "${MAKE}" | while read ratio scale _; do + # compute largest required + x=$((${scale}*${ratio%:*})); + y=$((${scale}*${ratio#*:})); + + find "${IMGS}" -mindepth 1 -maxdepth 1 -type d | sort | while read k; do + file="$(find ${k} -type f -name 'image.*')"; + + if test $(printf "%s\n" "${file}" | wc -l) -ne 1; then + printf "E: not exactly one image at '%s'!\n" "${k}"; + exit 1; + fi + + # FIXME: is it OK to hard-code '.png' here? + name=$(printf "%s\n" "${file}" | cut -d/ -f2); # sloppy, sorry + mkdir -p "${TEMP}"/generated/${name}; + make_real ${x}x${y} "${file}" "${TEMP}"/generated/${name}/${x}x${y}.png; + done +done + + +#--------------------------------------------------------------- +# output: scale all wallpapers +#--------------------------------------------------------------- + +## +# For each input image, generate a full set of output images. +# +# Note that this loop includes all columns; rely on 'size_only' +# to handle the rest. +# +printf "%s\n" "${MAKE}" | while read k; do + size_only "${TEMP}"/generated ${k}; +done + + +#--------------------------------------------------------------- +# output: metadata +#--------------------------------------------------------------- + +## +# FIXME: make this not ugly +# +temp=$(mktemp); +cat >> "${temp}" <<"EOF" +gnome-background-properties/Adelie.xml + + + +EOF + +find "${TEMP}"/generated -mindepth 1 -maxdepth 1 -type d | sort | while read k; do + name=$(printf "%s\n" "${k}" | cut -d/ -f3); # sloppy, sorry + # fix structure + mv "${KEEP}"/${name} "${KEEP}"/${name}.tmp; + mkdir -p "${KEEP}"/${name}/contents; + mv "${KEEP}"/${name}.tmp "${KEEP}"/${name}/contents/images; + + # compute metadata + case "${name}" in + background) + description="Default Background"; + author_name="Adélie Platform Team"; + ;; + lockscreen) + description="Default Lockscreen"; + author_name="Adélie Platform Team"; + ;; + *) + . "${IMGS}"/${name}/MANIFEST; + ;; + esac + + # write metadata to 'manifest.desktop' + # FIXME: we can do better than 'tr' below, but also what are + # the actual requirements? I'm just emulating what exists... + cat > "${KEEP}"/${name}/contents/metadata.desktop <> "${temp}" < + ${description} + /usr/share/wallpapers/${name}/contents/images/${file##*/} + zoom + +EOF + done +done + +## +# FIXME: make this not ugly +# +cat >> "${temp}" < +EOF + + +#--------------------------------------------------------------- +# output: create tarball +#--------------------------------------------------------------- + +mkdir -p adelie-wallpapers-${VTAG}/usr/share; + +# wallpapers +mv "${KEEP}" adelie-wallpapers-${VTAG}/usr/share/wallpapers; + +# gnome-background-properties +mkdir -p adelie-wallpapers-${VTAG}/usr/share/gnome-background-properties; +mv "${temp}" adelie-wallpapers-${VTAG}/usr/share/gnome-background-properties/Adelie.xml; + +# generate tarball +tar -pcJf adelie-wallpapers-${VTAG}.tar.xz adelie-wallpapers-${VTAG}; + +# clean up +rm -fr "${TEMP}"/generated; +rm -fr adelie-wallpapers-${VTAG}; \ No newline at end of file diff --git a/src/artisan/MANIFEST b/src/artisan/MANIFEST new file mode 100644 index 0000000..259fe49 --- /dev/null +++ b/src/artisan/MANIFEST @@ -0,0 +1,2 @@ +description="Artisan" +author_name="Horst G. Burkhardt" diff --git a/src/artisan/image.jpg b/src/artisan/image.jpg new file mode 100644 index 0000000..8535e08 Binary files /dev/null and b/src/artisan/image.jpg differ diff --git a/src/autumn-leaves/MANIFEST b/src/autumn-leaves/MANIFEST new file mode 100644 index 0000000..d8b477f --- /dev/null +++ b/src/autumn-leaves/MANIFEST @@ -0,0 +1,2 @@ +description="Autumn Leaves" +author_name="A. Wilcox" diff --git a/src/autumn-leaves/image.jpg b/src/autumn-leaves/image.jpg new file mode 100644 index 0000000..4a4bddc Binary files /dev/null and b/src/autumn-leaves/image.jpg differ diff --git a/src/cloudy-sky/MANIFEST b/src/cloudy-sky/MANIFEST new file mode 100644 index 0000000..667356b --- /dev/null +++ b/src/cloudy-sky/MANIFEST @@ -0,0 +1,2 @@ +description="Cloudy Sky" +author_name="A. Wilcox" diff --git a/src/cloudy-sky/image.jpg b/src/cloudy-sky/image.jpg new file mode 100644 index 0000000..c2ff60b Binary files /dev/null and b/src/cloudy-sky/image.jpg differ diff --git a/src/contentment/MANIFEST b/src/contentment/MANIFEST new file mode 100644 index 0000000..b58d0d3 --- /dev/null +++ b/src/contentment/MANIFEST @@ -0,0 +1,2 @@ +description="Contentment" +author_name="Horst G. Burkhardt" diff --git a/src/contentment/image.jpg b/src/contentment/image.jpg new file mode 100644 index 0000000..7d097f7 Binary files /dev/null and b/src/contentment/image.jpg differ diff --git a/src/ferris-wheel/MANIFEST b/src/ferris-wheel/MANIFEST new file mode 100644 index 0000000..b83fdb0 --- /dev/null +++ b/src/ferris-wheel/MANIFEST @@ -0,0 +1,2 @@ +description="Ferris Wheel" +author_name="Horst G. Burkhardt" diff --git a/src/ferris-wheel/image.jpg b/src/ferris-wheel/image.jpg new file mode 100644 index 0000000..acbecef Binary files /dev/null and b/src/ferris-wheel/image.jpg differ diff --git a/src/floral/MANIFEST b/src/floral/MANIFEST new file mode 100644 index 0000000..76e1960 --- /dev/null +++ b/src/floral/MANIFEST @@ -0,0 +1,2 @@ +description="Floral" +author_name="Horst G. Burkhardt" diff --git a/src/floral/image.jpg b/src/floral/image.jpg new file mode 100644 index 0000000..38fd497 Binary files /dev/null and b/src/floral/image.jpg differ diff --git a/src/harbour/MANIFEST b/src/harbour/MANIFEST new file mode 100644 index 0000000..83175c7 --- /dev/null +++ b/src/harbour/MANIFEST @@ -0,0 +1,2 @@ +description="Harbour" +author_name="Horst G. Burkhardt" diff --git a/src/harbour/image.jpg b/src/harbour/image.jpg new file mode 100644 index 0000000..2140519 Binary files /dev/null and b/src/harbour/image.jpg differ diff --git a/src/modern-motion/MANIFEST b/src/modern-motion/MANIFEST new file mode 100644 index 0000000..0cc7570 --- /dev/null +++ b/src/modern-motion/MANIFEST @@ -0,0 +1,2 @@ +description="Modern Motion" +author_name="Horst G. Burkhardt" diff --git a/src/modern-motion/image.jpg b/src/modern-motion/image.jpg new file mode 100644 index 0000000..b84436b Binary files /dev/null and b/src/modern-motion/image.jpg differ diff --git a/src/moon/MANIFEST b/src/moon/MANIFEST new file mode 100644 index 0000000..4307bb8 --- /dev/null +++ b/src/moon/MANIFEST @@ -0,0 +1,2 @@ +description="Moon" +author_name="A. Wilcox" diff --git a/src/moon/image.jpg b/src/moon/image.jpg new file mode 100644 index 0000000..cc40b2a Binary files /dev/null and b/src/moon/image.jpg differ diff --git a/src/sunset/MANIFEST b/src/sunset/MANIFEST new file mode 100644 index 0000000..7fc8f63 --- /dev/null +++ b/src/sunset/MANIFEST @@ -0,0 +1,2 @@ +description="Sunset" +author_name="Horst G. Burkhardt" diff --git a/src/sunset/image.jpg b/src/sunset/image.jpg new file mode 100644 index 0000000..52b0e12 Binary files /dev/null and b/src/sunset/image.jpg differ diff --git a/src/theseus/MANIFEST b/src/theseus/MANIFEST new file mode 100644 index 0000000..4d43487 --- /dev/null +++ b/src/theseus/MANIFEST @@ -0,0 +1,2 @@ +description="Theseus" +author_name="Horst G. Burkhardt" diff --git a/src/theseus/image.jpg b/src/theseus/image.jpg new file mode 100644 index 0000000..31740c8 Binary files /dev/null and b/src/theseus/image.jpg differ -- cgit v1.2.3-70-g09d2