mons: declare xrandr explicitly instead of using it from PATH

mons tries to detect if xrandr is installed in the PATH, failing
otherwise. However, this is not the way that packages are generally
packaged in nixpkgs.

This commit changes it to hardcode the path of xrandr explicitly instead
of depending of xrandr being declared in PATH.

+24
+10
pkgs/tools/misc/mons/default.nix
··· 12 fetchSubmodules = true; 13 }; 14 15 nativeBuildInputs = [ help2man ]; 16 makeFlags = [ 17 "DESTDIR=$(out)"
··· 12 fetchSubmodules = true; 13 }; 14 15 + patches = [ 16 + # Substitute xrandr path with @xrandr@ so we can replace it with 17 + # real path in substituteInPlace 18 + ./xrandr.patch 19 + ]; 20 + 21 + postPatch = '' 22 + substituteInPlace mons.sh --replace '@xrandr@' '${xrandr}/bin/xrandr' 23 + ''; 24 + 25 nativeBuildInputs = [ help2man ]; 26 makeFlags = [ 27 "DESTDIR=$(out)"
+14
pkgs/tools/misc/mons/xrandr.patch
···
··· 1 + diff --git a/mons.sh b/mons.sh 2 + index b86ce5c..feb0f33 100755 3 + --- a/mons.sh 4 + +++ b/mons.sh 5 + @@ -151,8 +151,7 @@ main() { 6 + # ============================= 7 + 8 + [ -z "$DISPLAY" ] && { echo 'DISPLAY: no variable set.'; exit 1; } 9 + - command -vp xrandr >/dev/null 2>&1 || { echo 'xrandr: command not found.'; exit 1; } 10 + - XRANDR="$(command -pv xrandr)" 11 + + XRANDR="@xrandr@" 12 + 13 + # ============================= 14 + # Argument Checking