betterlockscreen: make dunst optional

When dunst is detected *and* awesomeWM is used (its internal notification system to be exact)
then betterlockscreen waits for dunst to reply on the DBus. Due to dunstctl being in PATH
through the wrapper, dunst will always be tried to reach.

None of the workarounds mentioned in the awesome and betterlockscreen repos do not work with
this version, as dunstctl is always called and has to time out first.

In the current master of BLS there is a change that makes BLS check and env-var first, and
would ignore any dunstctl in PATH.

Once the new release happened this could still be used to reduce the closure size.
This commit is contained in:
Norbert Melzer 2023-05-13 20:28:52 +02:00
parent 790a208ab9
commit 64b347a30a

View File

@ -7,6 +7,7 @@
, bc
, coreutils
, dbus
, withDunst ? true
, dunst
, i3lock-color
, gawk
@ -17,6 +18,12 @@
, xorg
}:
let
runtimeDeps =
[ bc coreutils dbus i3lock-color gawk gnugrep gnused imagemagick procps xorg.xdpyinfo xorg.xrandr xorg.xset ]
++ lib.optionals withDunst [ dunst ];
in
stdenv.mkDerivation rec {
pname = "betterlockscreen";
version = "4.0.4";
@ -36,7 +43,7 @@ stdenv.mkDerivation rec {
mkdir -p $out/bin
cp betterlockscreen $out/bin/betterlockscreen
wrapProgram "$out/bin/betterlockscreen" \
--prefix PATH : "$out/bin:${lib.makeBinPath [ bc coreutils dbus dunst i3lock-color gawk gnugrep gnused imagemagick procps xorg.xdpyinfo xorg.xrandr xorg.xset ]}"
--prefix PATH : "$out/bin:${lib.makeBinPath runtimeDeps}"
runHook postInstall
'';