Merge pull request #114597 from thiagokokada/patch-mons
This commit is contained in:
commit
d496205cf2
@ -12,6 +12,16 @@ stdenv.mkDerivation rec {
|
|||||||
fetchSubmodules = true;
|
fetchSubmodules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
# Substitute xrandr path with @xrandr@ so we can replace it with
|
||||||
|
# real path in substituteInPlace
|
||||||
|
./xrandr.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace mons.sh --replace '@xrandr@' '${xrandr}/bin/xrandr'
|
||||||
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ help2man ];
|
nativeBuildInputs = [ help2man ];
|
||||||
makeFlags = [
|
makeFlags = [
|
||||||
"DESTDIR=$(out)"
|
"DESTDIR=$(out)"
|
||||||
@ -22,6 +32,6 @@ stdenv.mkDerivation rec {
|
|||||||
description = "POSIX Shell script to quickly manage 2-monitors display";
|
description = "POSIX Shell script to quickly manage 2-monitors display";
|
||||||
homepage = "https://github.com/Ventto/mons.git";
|
homepage = "https://github.com/Ventto/mons.git";
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
maintainers = [ maintainers.mschneider ];
|
maintainers = with maintainers; [ mschneider thiagokokada ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
14
pkgs/tools/misc/mons/xrandr.patch
Normal file
14
pkgs/tools/misc/mons/xrandr.patch
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
diff --git a/mons.sh b/mons.sh
|
||||||
|
index b86ce5c..feb0f33 100755
|
||||||
|
--- a/mons.sh
|
||||||
|
+++ b/mons.sh
|
||||||
|
@@ -151,8 +151,7 @@ main() {
|
||||||
|
# =============================
|
||||||
|
|
||||||
|
[ -z "$DISPLAY" ] && { echo 'DISPLAY: no variable set.'; exit 1; }
|
||||||
|
- command -vp xrandr >/dev/null 2>&1 || { echo 'xrandr: command not found.'; exit 1; }
|
||||||
|
- XRANDR="$(command -pv xrandr)"
|
||||||
|
+ XRANDR="@xrandr@"
|
||||||
|
|
||||||
|
# =============================
|
||||||
|
# Argument Checking
|
Loading…
Reference in New Issue
Block a user