summaryrefslogtreecommitdiff
path: root/svgtopng/pngtheme.sh
diff options
context:
space:
mode:
authorSean Davis <smd.seandavis@gmail.com>2018-08-15 21:28:20 -0400
committerSimon Steinbeiß <simon.steinbeiss@elfenbeinturm.at>2018-08-27 23:57:09 +0200
commitc4ea261a88e0418949163b4cb8d0df0a0e939627 (patch)
treea57d0e86bcbf2eadac989c2c121db70c5f6a2ca8 /svgtopng/pngtheme.sh
parent52f7c529ee027e87cdc972e17cb7a168bf557715 (diff)
downloadelementary-xfce-c4ea261a88e0418949163b4cb8d0df0a0e939627.tar.gz
Add Makefiles and svgtopng
Diffstat (limited to 'svgtopng/pngtheme.sh')
-rwxr-xr-xsvgtopng/pngtheme.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/svgtopng/pngtheme.sh b/svgtopng/pngtheme.sh
new file mode 100755
index 00000000..83dbf098
--- /dev/null
+++ b/svgtopng/pngtheme.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+icondir="$1"
+
+if test ! -d "$icondir"; then
+ echo "Pass a directory to the theme dir in the argument"
+ exit 1;
+fi
+
+if test ! -f "$icondir/index.theme"; then
+ echo "Not an icontheme directory!"
+ exit 1;
+fi
+
+cmd="svgtopng/svgtopng"
+
+echo "==================================="
+
+echo "Creating png icons from svg files and symlinks"
+#ignore list customized for elementary-xfce
+find "$icondir" -iname "*.svg" -not \( -wholename "*/scalable/*" -o -wholename "*/symbolic/*" -o -wholename "*/animations/*process-*" -o -wholename "*/animations/*gnome-spinner*" -o -wholename "*/animations*pk-action-refresh*" \) -exec $cmd {} +
+
+echo "==================================="
+
+echo "Cleanup icon directory"
+find "$icondir" -name "untitled folder" -type d -exec rm -rf {} +
+
+echo "==================================="
+
+echo "Deleting svg files"
+find "$icondir" -iname '*.svg' -not \( -wholename "*/scalable/*" -o -wholename "*/symbolic/*" -o -wholename "*/animations/*process-*" -o -wholename "*/animations/*gnome-spinner*" -o -wholename "*/animations*pk-action-refresh*" \) -delete
+
+echo "==================================="
+
+#ignore the output if the theme depends on another one (e.g. elementary-xfce-dark needs to be converted before elementary-xfce)
+echo "Checking dangling symlinks"
+find -L "$icondir" -type l -exec /bin/ls -go {} \;
+
+echo "==================================="