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