Skip to content

Instantly share code, notes, and snippets.

@alexluecke
Created March 30, 2017 01:57
Show Gist options
  • Save alexluecke/b2284e78cdfbd7e52e9b98e9c96912cc to your computer and use it in GitHub Desktop.
Save alexluecke/b2284e78cdfbd7e52e9b98e9c96912cc to your computer and use it in GitHub Desktop.
Sample render-asset.sh for modifying Arc theme
#! /bin/bash
INKSCAPE="/usr/bin/inkscape"
OPTIPNG="/usr/bin/optipng"
SRC_FILE="assets.svg"
DARK_SRC_FILE="assets-dark.svg"
ASSETS_DIR="assets"
DARK_ASSETS_DIR="assets-dark"
INDEX="assets.txt"
for i in `cat $INDEX`
do
if [ -f $DARK_ASSETS_DIR/$i.png ]; then
rm $DARK_ASSETS_DIR/$i.png;
fi
echo
echo Rendering $DARK_ASSETS_DIR/$i.png
$INKSCAPE --export-id=$i \
--export-id-only \
--export-dpi=160 \
--export-png=$DARK_ASSETS_DIR/$i.png $DARK_SRC_FILE >/dev/null \
&& $OPTIPNG -o7 --quiet $DARK_ASSETS_DIR/$i.png
done
cp $DARK_ASSETS_DIR/* ../xfwm4/.;
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment