#!/bin/sh
#
# wrapper script to update icon caches

for dir in /usr/share/icons/*/ ; do
	dir=${dir%/}
	[ -d "$dir" ] || continue
	if [ -e "$dir/index.theme" ]; then
		gtk-update-icon-cache -q -f "$dir" 2>/dev/null
	else
		rm -f "$dir/icon-theme.cache"
		rmdir --ignore-fail-on-non-empty "$dir"
	fi
done
