From 964b323d7ca25080deb1c787cb41cef05ff9f2de Mon Sep 17 00:00:00 2001 From: Cling <25270230@hdu.edu.cn> Date: Sun, 22 Feb 2026 05:31:28 +0800 Subject: [PATCH] fix: use convert as fallback for imagemagick v6 --- install.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index dfbd3bb..2b397e0 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,12 @@ #! /usr/bin/env bash +# Define which command to use for ImageMagick +if command -v magick &> /dev/null; then + _MAGICK="magick" +else + _MAGICK="convert" +fi + # Exit Immediately if a command fails set -o errexit @@ -127,7 +134,7 @@ generate() { sed -i "s/[0-9]\+x[0-9]\+/${custom_resolution}/" "${THEME_DIR}/${theme}/theme.txt" # Use appropriate background as base and resize it cp -a --no-preserve=ownership "${REO_DIR}/backgrounds/${asset_type}/background-${theme}.jpg" "${THEME_DIR}/${theme}/background.jpg" - magick "${THEME_DIR}/${theme}/background.jpg" -resize ${custom_resolution}^ -gravity center -extent ${custom_resolution} "${THEME_DIR}/${theme}/background.jpg" + "${_MAGICK}" "${THEME_DIR}/${theme}/background.jpg" -resize ${custom_resolution}^ -gravity center -extent ${custom_resolution} "${THEME_DIR}/${theme}/background.jpg" else cp -a --no-preserve=ownership "${REO_DIR}/config/theme-${screen}.txt" "${THEME_DIR}/${theme}/theme.txt" cp -a --no-preserve=ownership "${REO_DIR}/backgrounds/${screen}/background-${theme}.jpg" "${THEME_DIR}/${theme}/background.jpg" @@ -142,7 +149,7 @@ generate() { fi prompt -w "\n Using custom background.jpg as grub background image..." cp -a --no-preserve=ownership "${REO_DIR}/background.jpg" "${THEME_DIR}/${theme}/background.jpg" - magick "${THEME_DIR}/${theme}/background.jpg" -auto-orient "${THEME_DIR}/${theme}/background.jpg" + "${_MAGICK}" "${THEME_DIR}/${theme}/background.jpg" -auto-orient "${THEME_DIR}/${theme}/background.jpg" fi # Determine which assets to use based on custom resolution or screen