10 sound-theme-freedesktop,
14 stdenvNoCC.mkDerivation rec {
15 pname = "undistract-me";
16 version = "unstable-2020-08-09";
18 src = fetchFromGitHub {
21 rev = "2f8ac25c6ad8efcf160d2b480825b1cbb6772aab";
22 hash = "sha256-Qw7Cu9q0ZgK/RTvyDdHM5N3eBaKjtYqYH0J+hKMUZX8=";
26 # Don't block the terminal when notification sound is played
28 # See https://github.com/jml/undistract-me/pull/69
30 url = "https://github.com/jml/undistract-me/commit/2356ebbe8bf2bcb4b95af1ae2bcdc786ce7cc6e8.patch";
31 sha256 = "sha256-Ij3OXTOnIQsYhKVmqjChhN1q4ASZ7waOkfQTTp5XfPo=";
34 # Fix showing notifications when using Wayland apps with XWayland
35 # running, or connection to X server fails.
37 # NOTE: Without a real X server, notifications will not be
38 # suppressed when the window running the command is focused.
40 # See https://github.com/jml/undistract-me/pull/71
42 url = "https://github.com/jml/undistract-me/commit/3f4ceaf5a4eba8e3cb02236c48247f87e3d1124f.patch";
43 sha256 = "sha256-9AK9Jp3TXJ75Y+jwZXlwQ6j54FW1rOBddoktrm0VX68=";
49 # Patch in dependencies. Can't use makeWrapper because the bash
50 # functions will be sourced and invoked in a different environment
51 # for each command invocation.
53 for script in *.bash *.sh; do
54 substituteInPlace "$script" \
55 --replace /usr/share/undistract-me "$out/share/undistract-me" \
56 --replace basename ${coreutils}/bin/basename \
57 --replace 'cut ' '${coreutils}/bin/cut ' \
58 --replace date ${coreutils}/bin/date \
59 --replace dirname ${coreutils}/bin/dirname \
60 --replace sed ${gnused}/bin/sed \
61 --replace notify-send ${libnotify}/bin/notify-send \
62 --replace paplay ${pulseaudio}/bin/paplay \
63 --replace /usr/share/sounds/freedesktop ${sound-theme-freedesktop}/share/sounds/freedesktop \
64 --replace xprop ${xprop}/bin/xprop
69 mkdir -p "$out/share/undistract-me" "$out/etc/profile.d" "$out/share/licenses/undistract-me"
70 cp long-running.bash "$out/share/undistract-me"
71 cp preexec.bash "$out/share/undistract-me"
72 cp undistract-me.sh "$out/etc/profile.d"
73 cp LICENSE "$out/share/licenses/undistract-me"
77 description = "Notifies you when long-running terminal commands complete";
78 homepage = "https://github.com/jml/undistract-me";
79 license = licenses.mit;
80 maintainers = with maintainers; [ kira-bruneau ];