···
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=";
46
+
# Patch in dependencies. Can't use makeWrapper because the bash
47
+
# functions will be sourced and invoked in a different environment
48
+
# for each command invocation.
50
+
for script in *.bash *.sh; do
51
+
substituteInPlace "$script" \
52
+
--replace /usr/share/undistract-me "$out/share/undistract-me" \
53
+
--replace basename ${coreutils}/bin/basename \
54
+
--replace 'cut ' '${coreutils}/bin/cut ' \
55
+
--replace date ${coreutils}/bin/date \
56
+
--replace dirname ${coreutils}/bin/dirname \
57
+
--replace sed ${gnused}/bin/sed \
58
+
--replace notify-send ${libnotify}/bin/notify-send \
59
+
--replace paplay ${pulseaudio}/bin/paplay \
60
+
--replace /usr/share/sounds/freedesktop ${sound-theme-freedesktop}/share/sounds/freedesktop \
61
+
--replace xprop ${xprop}/bin/xprop
66
+
mkdir -p "$out/share/undistract-me" "$out/etc/profile.d" "$out/share/licenses/undistract-me"
67
+
cp long-running.bash "$out/share/undistract-me"
68
+
cp preexec.bash "$out/share/undistract-me"
69
+
cp undistract-me.sh "$out/etc/profile.d"
70
+
cp LICENSE "$out/share/licenses/undistract-me"
74
+
description = "Notifies you when long-running terminal commands complete";
75
+
homepage = "https://github.com/jml/undistract-me";
76
+
license = licenses.mit;
77
+
maintainers = with maintainers; [ metadark ];