start on stopped finish

script
	FC_CACHE_DIR=/var/cache/fontconfig
	if [ ! -d "${FC_CACHE_DIR}" ] || [ ! -f "${FC_CACHE_DIR}/cached" ]; then
		#[ ! -d "${FC_CACHE_DIR}" ] && logger -p user.debug -t fontconfig "Rebuilding entire font cache"
		#[ ! -f "${FC_CACHE_DIR}/cached" ] && logger -p user.debug -t fontconfig "Incremental rebuild of font cache"

		# make this a background task that is as nice as possible
		# idle i/o & idle cpu
		if ! ionice -c 3 nice -n 20 fc-cache; then
			if [ -x $(which logger) ]; then
				logger -p user.err -t fontconfig "Failed to build fontcache"
			fi
		else
			sync
			touch /var/cache/fontconfig/cached
		fi
	fi
end script

