zotero/scripts/make-z-icons
Dan Stillman fb2b874614 Add zotero-build repo as scripts folder
Minus obsolete 4.0 files
2023-04-26 04:40:22 -04:00

42 lines
1.3 KiB
Bash
Executable file

#!/bin/bash -e
#
# Generate platform-specific PNG files from SVG files for the main toolbar button
#
ROOT="$1"
SVG_ROOT="$ROOT/chrome/skin/default/zotero/zotero-z-32px-australis"
PLATFORM_PATH="$ROOT/chrome/content/zotero-platform"
if [ -z "$ROOT" ]; then
echo "Usage: $0 /path/to/zotero"
exit 1
fi
if [ ! -d "$ROOT" ]; then
echo "$1 is not a directory"
exit 1
fi
if [ ! -f "$SVG_ROOT-mac.svg" ]; then
echo "SVG file not found at $SVG-mac.svg"
exit 1
fi
# Mac
PLAT=mac
rm -f "$PLATFORM_PATH/$PLAT/"zotero-z-*-australis.png
svg2png $SVG_ROOT-$PLAT.svg --output "$PLATFORM_PATH/$PLAT/zotero-z-16px-australis.png" -w 16 -h 16
svg2png $SVG_ROOT-$PLAT.svg --output "$PLATFORM_PATH/$PLAT/zotero-z-32px-australis.png" -w 32 -h 32
# Windows
PLAT=win
rm -f "$PLATFORM_PATH/$PLAT/"zotero-z-*-australis.png
svg2png $SVG_ROOT-$PLAT.svg --output "$PLATFORM_PATH/$PLAT/zotero-z-16px-australis.png" -w 16 -h 16
svg2png $SVG_ROOT-$PLAT.svg --output "$PLATFORM_PATH/$PLAT/zotero-z-32px-australis.png" -w 32 -h 32
# Linux
PLAT=unix
rm -f "$PLATFORM_PATH/$PLAT/"zotero-z-*-australis.png
svg2png $SVG_ROOT-$PLAT.svg --output "$PLATFORM_PATH/$PLAT/zotero-z-16px-australis.png" -w 16 -h 16
svg2png $SVG_ROOT-$PLAT.svg --output "$PLATFORM_PATH/$PLAT/zotero-z-32px-australis.png" -w 32 -h 32