Skip to content

Instantly share code, notes, and snippets.

@dw72
Created November 27, 2016 14:40
Show Gist options
  • Save dw72/24dc5891b35b3a7ed53737272ed10b2d to your computer and use it in GitHub Desktop.
Save dw72/24dc5891b35b3a7ed53737272ed10b2d to your computer and use it in GitHub Desktop.
Generate and install png icons from svg file
#!/usr/bin/bash
src=$1
dst=${1%.*}.png
[[ -z "$2" ]] && type="apps" || type=$2
for i in 16 22 24 32 64 128
do
inkscape -z -e $dst -w $i -h $i $src
xdg-icon-resource install --context $type --size $i $dst
rm $dst
done
@Natetronn
Copy link

why no 48x48?

You can add any size you want to the for loop. I updated it to include 48x48 for you, but add any more you think you'd need.

These are all the ones that currently exist on my machine:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment