Category Archives: Agave

Icon theme cache issues

So I spent a good deal of saturday chasing down a bug in Agave that was reported by somebody trying to make a Debian package of it. Some time ago, when the second “GNOME Goal” was introduced for Installing theme-friendly icons, I decided I’d do that to Agave as well. (By the way, those little goals were kind of a nice way for new contributors to feel useful, are there plans for any more?). Everything worked fine until a couple days ago when I had a report of a crash when installing the application to /usr due to an icon not being found in /usr/local/share/icons/hicolor/...

Why was it looking in /usr/local/...??? I scoured my source code for hard-coded references to /usr/local, and not finding any, I sat scratching my head for a good long while. Now, somebody more familiar with gtk icon theme issues may have recognized the problem immediately, but it took me quite a while to figure it out, so I thought I’d post the solution in case anybody else runs in to the same issue. The problem only shows up if you’ve first installed the application to /usr/local (the default) and then uninstalled it and installed it to /usr.

The GNOME Goal page mentioned above suggests an install-data-hook rule which updates the gtk icon cache after the program’s icons are installed. So the icon cache in /usr/local gets updated when you first install the program to /usr/local. Unfortunately, after uninstalling the application, the icon cache is not updated, so gtk still thinks there are application icons located under /usr/local.

Since /usr/local/ is in the icon theme search path before /usr, when the application is installed to /usr, it will find the stale icon cache in /usr/local and think it found the icon you’ve requested. Unfortunately the icon that it ‘found’ has already been deleted, so it will try to load an icon from /usr/local that doesn’t exist, and the program crashes. The solution is to simply add an uninstall-hook that also updates the gtk icon cache so that you don’t have a stale icon cache after you run `make uninstall`. Something like the following:

gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
install-data-hook: update-icon-cache
uninstall-hook: update-icon-cache
        @-if test -z "$(DESTDIR)"; then
                 echo "Updating Gtk icon cache.";
                 echo "*** Icon cache not updated.  After install, run this:";
                 echo "***   $(gtk_update_icon_cache)";

Colorscheme to Agave

At long last, I’ve released a new version of GNOME Colorscheme. Only I’ve changed the name of the application with this release. The new name is Agave. I decided to change the name of the application after I found that people often assumed (due to the name) that it was an application that could be used to change the colorscheme of their desktop (i.e. window borders, etc). Plus I was just never happy with such a generic name.

Other than the name change / re-branding, there’s not a lot of major changes, but there are few minor improvements and an additional translation (Catalan). And now that I’ve got the name-change release out of the way, I can get back to working on some bigger changes to the application. I’ve been working on a branch to implement a custom TreeModel which can use standard C++ containers (e.g. std::vector) as its data store. This is of course completely uninteresting from a user perspective, but it makes the code much cleaner and maintainable as I don’t have to keep a standard container synchronized with the data in a ListModel and vice versa. I’ve just merged these changes back into master.

I have hopes that at some point a generic standard-container-based TreeModel can be shipped with gtkmm, but I think it needs a bit of testing here before I can propose adding anything to gtkmm. The implementation I’m using right now is still a bit rough around the edges since this is the first time I’ve ever implemented a custom TreeModel, but I think it’ll get there eventually.

In addition, I’ve got a few ideas regarding improving the UI for picking colors, and some other things. So that should start picking up soon as well.

In addition, with many thanks to Ross Burton, Agave is making its way into the Debian repository. You can keep an eye on its progress in the Debian NEW queue. Also, it looks like you can grab it from Ross’s personal repository if you want to try it out before it actually gets accepted into the official repository. Thanks Ross.