all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Helping programs find their icons
@ 2015-02-05  6:24 Mark H Weaver
  2015-02-05  9:53 ` Andreas Enge
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mark H Weaver @ 2015-02-05  6:24 UTC (permalink / raw)
  To: guix-devel

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.

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

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Helping programs find their icons
  2015-02-05  6:24 Helping programs find their icons Mark H Weaver
@ 2015-02-05  9:53 ` Andreas Enge
  2015-02-05 12:43 ` 宋文武
  2015-02-05 20:41 ` Ludovic Courtès
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Enge @ 2015-02-05  9:53 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

Would it not help to add hicolor-icon-theme as a propagated input to
some packages? Or maybe add it as a propagated input inside
glib-or-gtk-build-system if that is possible?

Andreas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Helping programs find their icons
  2015-02-05  6:24 Helping programs find their icons Mark H Weaver
  2015-02-05  9:53 ` Andreas Enge
@ 2015-02-05 12:43 ` 宋文武
  2015-02-05 20:41 ` Ludovic Courtès
  2 siblings, 0 replies; 4+ messages in thread
From: 宋文武 @ 2015-02-05 12:43 UTC (permalink / raw)
  To: Mark H Weaver, guix-devel

Mark H Weaver <mhw@netris.org> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Helping programs find their icons
  2015-02-05  6:24 Helping programs find their icons Mark H Weaver
  2015-02-05  9:53 ` Andreas Enge
  2015-02-05 12:43 ` 宋文武
@ 2015-02-05 20:41 ` Ludovic Courtès
  2 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2015-02-05 20:41 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

Mark H Weaver <mhw@netris.org> skribis:

> 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
>
> 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.

As 宋文武 suggests, glib-or-gtk-build-system may solve the problem if we
add ‘hicolor-icon-theme’ to the inputs, because it would automatically
add it to $XDG_DATA_DIRS.  Wouldn’t it?

Currently things like Evince, for instance, do find their icons.
GIMP and Inkscape are fine too, but I think they use slightly different
mechanisms.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-02-05 20:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-05  6:24 Helping programs find their icons Mark H Weaver
2015-02-05  9:53 ` Andreas Enge
2015-02-05 12:43 ` 宋文武
2015-02-05 20:41 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.