shutter: wrap XDG_DATA_DIRS with hicolor-icon-theme

When opening `shutter` it adds an indicator icon to the status bar.
However this doesn't happen (and an ugly default icon will be used) if
`shutter` can't find the `hicolor-icon-theme`. In such a case a warning
like this can be found in `stderr`:

```
Gtk-WARNING **: Could not find the icon 'image-png'. The 'hicolor' theme
was not found either, perhaps you need to install it.
```

As I don't think that we should force users to install this theme
globally and several other packages including `tor-browser`, `gparted`
or `clawsmail` add `hicolor-icon-theme` to their closure this seems to
be a fair measure.
This commit is contained in:
Maximilian Bosch 2018-05-03 11:25:19 +02:00
parent ae7c71e267
commit 40226e647e
No known key found for this signature in database
GPG Key ID: 091DBF4D1FC46B8E

View File

@ -1,4 +1,6 @@
{ stdenv, fetchurl, fetchpatch, perl, perlPackages, makeWrapper, imagemagick, gdk_pixbuf, librsvg }:
{ stdenv, fetchurl, fetchpatch, perl, perlPackages, makeWrapper, imagemagick, gdk_pixbuf, librsvg
, hicolor-icon-theme
}:
let
perlModules = with perlPackages;
@ -29,6 +31,7 @@ stdenv.mkDerivation rec {
wrapProgram $out/bin/shutter \
--set PERL5LIB "${stdenv.lib.makePerlPath perlModules}" \
--prefix PATH : "${imagemagick.out}/bin" \
--suffix XDG_DATA_DIRS : "${hicolor-icon-theme}/share" \
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
'';