Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: batch svg files for inkscape #54

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions scripts/build-xcursor-plasmasvg
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,24 @@ done
mkdir -p "$BUILD_DIR/config"

# Generate pixmaps
genPixmaps=""
for RAWSVG in ${RAWSVG_DIR}/*.svg; do
BASENAME=${RAWSVG##*/}
BASENAME=${BASENAME%.*}
genPixmaps="file-open:${RAWSVG};"
genPixmaps+=" file-open:${RAWSVG};"

for scale in $SCALES; do
DIR="$BUILD_DIR/x${scale}"
if [[ "${DIR}/${BASENAME}.png" -ot ${RAWSVG} ]]; then
genPixmaps="${genPixmaps} export-width:$((${REAL_SIZE}*scale/100)); export-height:$((${REAL_SIZE}*scale/100)); export-filename:${DIR}/${BASENAME}.png; export-do;"
genPixmaps+=" export-width:$((${REAL_SIZE}*scale/100)); export-height:$((${REAL_SIZE}*scale/100)); export-filename:${DIR}/${BASENAME}.png; export-do;"
fi
done
if [ "$genPixmaps" != "file-open:${RAWSVG};" ]; then
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is lost don't think it's needed since we no longer call inkscape for every file,
but can be added by setting a flag inside the if above.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works fine without

inkscape --shell <<<${genPixmaps} &>/dev/null
fi
genPixmaps+=" file-close;"

done

inkscape --shell <<<${genPixmaps} &>/dev/null

# Generate cursor theme
OUTPUT=$3
rm -rf "$OUTPUT"
Expand Down