Red Hat
Jun 29, 2009
by Trustin Lee

When a new GTK+ application is installed, the newly added launcher item sometimes does not have its icon. It’s mostly because the icon cache is not up-to-date. You can fix this problem by regenerating or rebuilding the GTK+ icon cache using the following command:

gtk-update-icon-cache -f '/usr/share/icons/<THEME_NAME>'

However, we can simply update the whole cache without thinking much because updating the cache take not much time. I just put the following script into /etc/cron.daily so that the cache is fixed and the missing icon appears overnight:

#!/bin/sh
find /usr/share/icons -mindepth 1 -maxdepth 1 -type d | while read -r THEME; do
  if [ -f "$THEME/index.theme" ]; then
    gtk-update-icon-cache -f -q "$THEME"
  fi
done