dunst: wrap dunstctl command with its runtime dependencies

Running `dunstctl` with `PATH` unset currently results in:

```
$ env PATH= ./result/bin/dunstctl is-paused
Command dbus-send not found
```

This is because `dunstctl` is a script that uses `dbus-send` and `cat`
during runtime. With this commit `dunstctl` works correctly even with
`PATH` unset:

```
$ env PATH= ./result/bin/dunstctl is-paused
false
```
This commit is contained in:
Thiago Kenji Okada 2023-05-19 11:55:49 +01:00 committed by Anderson Torres
parent 765f0212c9
commit b83961d3f0

View File

@ -1,5 +1,5 @@
{ stdenv, lib, fetchFromGitHub, makeWrapper
, pkg-config, which, perl, jq, libXrandr
, pkg-config, which, perl, jq, libXrandr, coreutils
, cairo, dbus, systemd, gdk-pixbuf, glib, libX11, libXScrnSaver
, wayland, wayland-protocols
, libXinerama, libnotify, pango, xorgproto, librsvg
@ -39,6 +39,9 @@ stdenv.mkDerivation rec {
wrapProgram $out/bin/dunst \
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
wrapProgram $out/bin/dunstctl \
--prefix PATH : "${lib.makeBinPath [ coreutils dbus ]}"
install -D contrib/_dunst.zshcomp $out/share/zsh/site-functions/_dunst
install -D contrib/_dunstctl.zshcomp $out/share/zsh/site-functions/_dunstctl
substituteInPlace $out/share/zsh/site-functions/_dunstctl \