mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-29 17:28:53 +00:00
88b735b6be
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
24 lines
609 B
Bash
Executable File
24 lines
609 B
Bash
Executable File
#! /bin/bash
|
|
# Based on <http://stackoverflow.com/a/23688878/393146>
|
|
# converts the passed-in svgs to ico format
|
|
|
|
if [[ "$#" -eq 0 ]]; then
|
|
echo "Usage: $0 svg1 [svg2 [...]]"
|
|
exit 0
|
|
fi
|
|
|
|
temp="$(mktemp -d)"
|
|
declare -a res=(16 24 32 48 64 256)
|
|
for f in "$*"; do
|
|
name="`basename -s .svg "$f"`"
|
|
iconset="$temp/${name}.iconset"
|
|
mkdir -p "$iconset"
|
|
for r in "${res[@]}"; do
|
|
inkscape -z -e "$iconset/${name}${r}.png" -w "$r" -h "$r" "$f"
|
|
done
|
|
resm=( "${res[@]/#/$iconset/${name}}" )
|
|
resm=( "${resm[@]/%/.png}" )
|
|
convert "${resm[@]}" "${f%%.*}.ico"
|
|
done
|
|
rm -rf "$temp"
|