aboutsummaryrefslogtreecommitdiff
path: root/cmake/Win32CleanupAdwaita.sh
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/Win32CleanupAdwaita.sh')
-rw-r--r--cmake/Win32CleanupAdwaita.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/cmake/Win32CleanupAdwaita.sh b/cmake/Win32CleanupAdwaita.sh
new file mode 100644
index 0000000..194f959
--- /dev/null
+++ b/cmake/Win32CleanupAdwaita.sh
@@ -0,0 +1,19 @@
+#!/bin/sh -e
+# Removes unused icons from the Adwaita theme, it could be even more aggressive,
+# since it keeps around lots of sizes and all the GTK+ stock icons
+export LC_ALL=C
+find share/icons/Adwaita -type f | awk 'BEGIN {
+ while (("grep -aho \"[a-z][a-z-]*\" *.dll *.exe" | getline) > 0)
+ good[$0] = 1
+} /[.](png|svg|cur|ani)$/ {
+ # Cut out the basename without extensions
+ match($0, /[^\/]+$/)
+ base = substr($0, RSTART)
+ sub(/[.].+$/, "", base)
+
+ # Try matching while cutting off suffixes
+ while (!(keep = good[base]) &&
+ sub(/-(ltr|rtl|symbolic)$/, "", base)) {}
+ if (!keep)
+ print
+}' | xargs rm