Skip to content

Instantly share code, notes, and snippets.

@defHLT
Last active December 23, 2015 01:38
Show Gist options
  • Save defHLT/6561313 to your computer and use it in GitHub Desktop.
Save defHLT/6561313 to your computer and use it in GitHub Desktop.
#!/usr/bin/zsh
# e.g. -> ./gen_icons.sh ic_launcher.svg
#
PNGS=""
BASENAME=`basename $1 .svg`
mkdir -p drawable-{mdpi,hdpi,xhdpi,xxhdpi} google-play
inkscape -z -h 48 -w 48 -e drawable-mdpi/$BASENAME.png $1
inkscape -z -h 72 -w 72 -e drawable-hdpi/$BASENAME.png $1
inkscape -z -h 96 -w 96 -e drawable-xhdpi/$BASENAME.png $1
inkscape -z -h 144 -w 144 -e drawable-xxhdpi/$BASENAME.png $1
#inkscape -z -h 192 -w 192 -e $BASENAME/drawable-xxxdpi/$1.png $i
inkscape -z -h 512 -w 512 -e google-play/$BASENAME.png $1
PNGS+=`echo drawable-{mdpi,hdpi,xhdpi,xxhdpi}/$BASENAME.png google-play/$BASENAME.png`
qiv -Df `echo $PNGS` #quick image viewer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment