From 8fb4acc4c2caa01e20ba1e73924e90c86b6005ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Thu, 9 Aug 2018 22:29:16 +0200 Subject: [PATCH] Added LOC icons generation Broken SVG rendering workaround + code cleanup --- icons/scripts/extensions | 10 ++++++++++ icons/scripts/icns.sh | 7 ++----- icons/scripts/ico.sh | 7 ++----- 3 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 icons/scripts/extensions diff --git a/icons/scripts/extensions b/icons/scripts/extensions new file mode 100644 index 00000000..1509f572 --- /dev/null +++ b/icons/scripts/extensions @@ -0,0 +1,10 @@ +fit:#006600 +gpx:#003399 +igc:#ff3300 +kml:#990000 +nmea:#0083d7 +plt:#66ff00 +rte:#66ff00 +tcx:#ffcc00 +wpt:#66ff00 +loc:#556677 diff --git a/icons/scripts/icns.sh b/icons/scripts/icns.sh index 113b0c67..7d9772bb 100755 --- a/icons/scripts/icns.sh +++ b/icons/scripts/icns.sh @@ -1,9 +1,6 @@ #!/bin/bash -EXTENSIONS="fit:#006600 gpx:#003399 igc:#ff3300 kml:#990000 nmea:#0083d7 \ - plt:#66ff00 rte:#66ff00 tcx:#ffcc00 wpt:#66ff00" - -for e in $EXTENSIONS; do +while read e; do IFS=":"; set $e EXT=`echo $1 | tr /a-z/ /A-Z/` @@ -25,4 +22,4 @@ for e in $EXTENSIONS; do iconutil -c icns -o $1.icns "$ICONSET" rm -R "$ICONSET" $1.svg -done +done < extensions diff --git a/icons/scripts/ico.sh b/icons/scripts/ico.sh index a0d27da3..13883904 100755 --- a/icons/scripts/ico.sh +++ b/icons/scripts/ico.sh @@ -1,13 +1,10 @@ #!/bin/bash -EXTENSIONS="fit:#006600 gpx:#003399 igc:#ff3300 kml:#990000 nmea:#0083d7 \ - plt:#66ff00 rte:#66ff00 tcx:#ffcc00 wpt:#66ff00" - -for e in $EXTENSIONS; do +while read e; do IFS=":"; set $e EXT=`echo $1 | tr /a-z/ /A-Z/` sed -e "s/\$EXTENSION/$EXT/" -e "s/\$COLOR/$2/" icon-template.svg > $1.svg convert -density 400 $1.svg -define icon:auto-resize $1.ico rm $1.svg -done +done < extensions