scripts/screenshot: fix replace matching

This commit is contained in:
Guanran Wang 2024-07-08 13:58:31 +08:00
parent e7029ac06b
commit 708f1e60b7
Signed by: nyancat
GPG key ID: 91F97D9ED12639CF

View file

@ -14,10 +14,10 @@ makeScript {
runtimeInputs = [coreutils jq grim slurp swappy wl-clipboard libnotify];
src = fetchurl {
url = "https://raw.githubusercontent.com/nwg-piotr/nwg-shell/c29e8eb4658a2613fb221ead0b101c75f457bcaf/scripts/screenshot";
hash = "sha256-Z/fWloz8pLHsvPTPOeBxnbMsGDRTY3G3l/uePQ3ZxjU=";
hash = "sha256-w0zdCX6az0WNM0G4RrNuKbQ0O9aSIK6ssAMMaFlsjA0=";
postFetch = ''
substituteInPlace $out \
--replace-warn "DIR=\''${SCREENSHOT_DIR:=$HOME/Screenshots}" "DIR=$HOME/Pictures/Screenshots"
--replace-fail 'DIR=''${SCREENSHOT_DIR:=$HOME/Screenshots}' 'DIR=$HOME/Pictures/Screenshots'
'';
};
}