source: trunk/misc/build_helpers/icons/make-windows-icon.sh

Last change on this file was 88b735b6, checked in by Daira Hopwood <daira@…>, at 2015-04-30T14:24:12Z

Build Tahoe-LAFS icon for OS X and Windows. refs ticket:2323

Signed-off-by: Daira Hopwood <daira@…>

  • Property mode set to 100755
File size: 609 bytes
Line 
1#! /bin/bash
2# Based on <http://stackoverflow.com/a/23688878/393146>
3# converts the passed-in svgs to ico format
4
5if [[ "$#" -eq 0 ]]; then
6    echo "Usage: $0 svg1 [svg2 [...]]"
7    exit 0
8fi
9
10temp="$(mktemp -d)"
11declare -a res=(16 24 32 48 64 256)
12for f in "$*"; do
13    name="`basename -s .svg "$f"`"
14    iconset="$temp/${name}.iconset"
15    mkdir -p "$iconset"
16    for r in "${res[@]}"; do
17        inkscape -z -e "$iconset/${name}${r}.png" -w "$r" -h "$r" "$f"
18    done
19    resm=( "${res[@]/#/$iconset/${name}}" )
20    resm=( "${resm[@]/%/.png}" )
21    convert "${resm[@]}" "${f%%.*}.ico"
22done
23rm -rf "$temp"
Note: See TracBrowser for help on using the repository browser.