blob: 5146be248da0594d282b3de626adf74de049eb50 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
{ fetchgit, stdenv, disper ? null, xrandr, xdpyinfo }:
let
rev = "4f5e2401ef";
in
stdenv.mkDerivation {
name = "autorandr-${rev}";
src = fetchgit {
inherit rev;
url = "https://github.com/wertarbyte/autorandr.git";
};
patchPhase = ''
substituteInPlace "autorandr" \
--replace "/usr/bin/xrandr" "${xrandr}/bin/xrandr" \
--replace "/usr/bin/xdpyinfo" "${xdpyinfo}/bin/xdpyinfo"
'' + stdenv.lib.optionalString (disper != null) ''
substituteInPlace "autorandr"
--replace "/usr/bin/disper" "${disper}/bin/disper"
'';
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 = {
description = "Autorandr, automatic display configuration selector based on connected devices";
homepage = https://github.com/wertarbyte/autorandr;
};
}
|