2013-09-26 13:12:01 +02:00
|
|
|
{ fetchgit
|
|
|
|
, stdenv
|
|
|
|
, enableXRandr ? true, xrandr ? null
|
|
|
|
, enableDisper ? false, disper ? null
|
|
|
|
, xdpyinfo }:
|
|
|
|
|
|
|
|
assert enableXRandr -> xrandr != null;
|
|
|
|
assert enableDisper -> disper != null;
|
2013-09-25 00:10:59 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
rev = "4f5e2401ef";
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "autorandr-${rev}";
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
inherit rev;
|
|
|
|
url = "https://github.com/wertarbyte/autorandr.git";
|
|
|
|
};
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace "autorandr" \
|
2013-09-26 13:12:01 +02:00
|
|
|
--replace "/usr/bin/xrandr" "${if enableXRandr then xrandr else "/nowhere"}/bin/xrandr" \
|
|
|
|
--replace "/usr/bin/disper" "${if enableDisper then disper else "/nowhere"}/bin/disper" \
|
2013-09-25 00:10:59 +02:00
|
|
|
--replace "/usr/bin/xdpyinfo" "${xdpyinfo}/bin/xdpyinfo"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p "$out/etc/bash_completion.d"
|
|
|
|
cp -v bash_completion/autorandr "$out/etc/bash_completion.d"
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
cp -v autorandr auto-disper $out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2013-10-05 16:22:46 +02:00
|
|
|
description = "Automatic display configuration selector based on connected devices";
|
2013-09-25 00:10:59 +02:00
|
|
|
homepage = https://github.com/wertarbyte/autorandr;
|
2013-09-25 00:10:59 +02:00
|
|
|
maintainer = [ stdenv.lib.maintainers.coroa ];
|
2013-09-25 00:10:59 +02:00
|
|
|
};
|
|
|
|
}
|