icon cache plugin

v4hn me at v4hn.de
Thu Jun 28 21:21:41 CEST 2012


Good evening everyone,

at the moment lunar has a slight problem with icon management
as far as I can see. At least with my local E17 desktop
the icons of most newly installed modules are missing in the menu.
To fix this, I have to run `gtk-update-icon-cache -f /usr/share/icons/hicolor/`
manually.

A handful of modules run this command in BUILD after they installed their icons.
However, this way the cache file icons/hicolor/icon-theme.cache belongs to
this module which doesn't make sense.

As nearly every module with a desktop application would need to run this update
in POST_INSTALL, I prefer to add the attached lunar plugin to gtk+-2.
It simply checks if some icons were installed and updates the corresponding
cache file.

Please check if the plugin works fine for you and
if nobody objects within a week, I'll add the plugin to gtk
and remove all unneccessary calls to gtk-update-icon-cache from the moonbase.


v4hn
-------------- next part --------------
#!/bin/bash
#############################################################
#                                                           #
# postbuild-sanity.plugin - postbuild icon cache refreshing #
#                                                           #
#############################################################
#                                                           #
# Copyright 2012 by v4hn @v4hn.de under GPLv2               #
#                                                           #
#############################################################


plugin_gtk_iconcache_post_build()
{
    if [ -z "`which gtk-update-icon-cache 2>/dev/null`" ]; then
        #just skip this plugin if gtk-update-icon-cache is not available
        return 2;
    fi

    parse_iw | grep -q "^/usr/share/icons/.*/"
    if [ $? -eq 0 ]; then
        parse_iw | grep "^/usr/share/icons/.*/" | sort | sed -e 's:^\(/usr/share/icons/[^/]*/\).*$:\1:' | uniq | \
        while read theme; do
            if [ -f $theme/index.theme ]; then
                gtk-update-icon-cache -f $theme
            fi
        done
    fi

    return 2;
}


plugin_register BUILD_POST_BUILD plugin_gtk_iconcache_post_build
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://foo-projects.org/pipermail/lunar-dev/attachments/20120628/b7a02d17/attachment.bin>


More information about the Lunar-dev mailing list