From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?B?5a6L5paH5q2m?= Subject: Re: Helping programs find their icons Date: Thu, 05 Feb 2015 20:43:19 +0800 Message-ID: <87wq3w5y1k.fsf@gmail.com> References: <87r3u4kh8x.fsf@netris.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJLmD-0002ex-QK for guix-devel@gnu.org; Thu, 05 Feb 2015 07:43:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJLm8-0002op-A0 for guix-devel@gnu.org; Thu, 05 Feb 2015 07:43:21 -0500 Received: from mail-pd0-f180.google.com ([209.85.192.180]:43514) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJLm8-0002oh-3m for guix-devel@gnu.org; Thu, 05 Feb 2015 07:43:16 -0500 Received: by pdev10 with SMTP id v10so7583533pde.10 for ; Thu, 05 Feb 2015 04:43:15 -0800 (PST) In-Reply-To: <87r3u4kh8x.fsf@netris.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mark H Weaver , guix-devel@gnu.org Mark H Weaver writes: > Hello Guix, > > I've investigated why wicd-gtk is unable to find its icons and fixed it. > Looking at the output of strace, I found that when wicd-gtk looks for > icons, it searches for 'index.theme' files in many different directories > of the form: > > /gnu/store/.../share/icons/hicolor/ > > The icons it wanted were in one of the directories it searched, but > apparently the lack of 'index.theme' inhibited it from loading the fonts > from that directory. > > I've found only one package that includes > share/icons/hicolor/index.theme, and that's 'hicolor-icon-theme'. The > 'index.theme' file turned out to be quite generic. It describes the > directory structure, but does not list the individual icons present. > > I modified the 'wicd' package to copy 'index.theme' from > 'hicolor-icon-theme' into the same directory of 'wicd', and that fixed > the problem: wicd-gtk now has working icons. I think you mean the icon now show in wicd-gtk itself? then wrap it with XDG_DATA_DIRS=$hicolor-icon-theme/share:$wicd/share should have same effect. > > However, this problem is quite widespread. Many of our gtk packages > install icons into $out/share/icons/hicolor but have no 'index.theme', > and I suspect that's the reason the xfce application menu is missing so > many icons. > > inkscape-0.91 > emacs-24.4 > gtk+-3.14.7 > xfce4-session-4.10.0 > xfwm4-4.10.0 > exo-0.8.0 > thunar-1.4.0 > xfce4-panel-4.10.0 > xfdesktop-4.10.0 > xfce4-battery-plugin-1.0.5 > transmission-2.84 This is another story, I think the icon finding path is: THEME=0 for dir in "$XDG_DATA_DIRS:$out/share"; do if [ ! -e "$dir/icons/hicolor/index.theme" && $THEME = 0 ]; then continue else THEME=1 fi if [ -e "$dir/icons/hicoror/icon-theme.cache" ]; then icon = $(lookup from icon-theme.cache) if $icon; then return $icon else continue # even we may have the icon in dir fi icon = $(lookup from dir) # slow if $icon; then return $icon fi done I just pushed the 'xfce' meta-package, it use 'glib-or-gtk-build-system' to set a XDG_DATA_DIRS contain xfce4-panel, xfce4-battery-plugin, etc. Icons from those propagated packages can be found, but packages from user's profile can not. The problem is we have a incomplete icon-theme.cache in profile, we should either remove it or generate a complete one. > > I think it might be helpful to add a post-install phase to > 'glib-or-gtk-build-system' that installs 'index.theme' from > 'hicolor-icon-theme' if $out/share/icons/hicolor exists. > > We might also have to install 'index.theme' from 'gnome-icon-theme' if > $out/share/icons/gnome exists. > > That is, unless someone has a better suggestion. Any ideas? > > Thanks, > Mark