2013-09-26 12:12:01 +01:00
|
|
|
{ fetchgit
|
|
|
|
, stdenv
|
|
|
|
, enableXRandr ? true, xrandr ? null
|
|
|
|
, enableDisper ? false, disper ? null
|
|
|
|
, xdpyinfo }:
|
|
|
|
|
|
|
|
assert enableXRandr -> xrandr != null;
|
|
|
|
assert enableDisper -> disper != null;
|
2013-09-24 23:10:59 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
rev = "4f5e2401ef";
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "autorandr-${rev}";
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
inherit rev;
|
|
|
|
url = "https://github.com/wertarbyte/autorandr.git";
|
2014-03-18 10:15:59 +00:00
|
|
|
sha256 = "1x8agg6mf5jr0imw7dznr8kxyw970bf252bda9q7b0z4yksya2zd";
|
2013-09-24 23:10:59 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace "autorandr" \
|
2013-09-26 12:12:01 +01: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-24 23:10:59 +01: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 15:22:46 +01:00
|
|
|
description = "Automatic display configuration selector based on connected devices";
|
2013-09-24 23:10:59 +01:00
|
|
|
homepage = https://github.com/wertarbyte/autorandr;
|
2014-04-23 13:26:16 +01:00
|
|
|
maintainers = [ stdenv.lib.maintainers.coroa ];
|
2013-09-24 23:10:59 +01:00
|
|
|
};
|
|
|
|
}
|