summary refs log tree commit diff
path: root/pkgs/tools/misc/mons/default.nix
blob: 920cab1763b8e062d29ed8814b85045c384b1c5a (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
35
36
37
{ stdenv, lib, fetchFromGitHub, help2man, xrandr }:

stdenv.mkDerivation rec {
  pname = "mons";
  version = "20200320";

  src = fetchFromGitHub {
    owner = "Ventto";
    repo = pname;
    rev = "375bbba3aa700c8b3b33645a7fb70605c8b0ff0c";
    sha256 = "19r5y721yrxhd9jp99s29jjvm0p87vl6xfjlcj38bljq903f21cl";
    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 ];
  makeFlags = [
    "DESTDIR=$(out)"
    "PREFIX="
  ];

  meta = with lib; {
    description = "POSIX Shell script to quickly manage 2-monitors display";
    homepage = "https://github.com/Ventto/mons.git";
    license = licenses.mit;
    maintainers = with maintainers; [ mschneider thiagokokada ];
  };
}