about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/py3status/default.nix
blob: f0f5484aeb56f8c9a9999f98983ec55ef0ab21ee (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{ lib
, buildPythonPackage
, acpi
, alsa-utils
, coreutils
, dbus-python
, fetchPypi
, file
, i3
, i3ipc
, libnotify
, lm_sensors
, procps
, pydbus
, pygobject3
, pyserial
, pytz
, requests
, setuptools
, tzlocal
, xorg
}:

buildPythonPackage rec {
  pname = "py3status";
  version = "3.53";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-vZrzHERjAg9J004A2dAbq8hKmAUslCTaRdwEAe9JRqU=";
  };

  propagatedBuildInputs = [
    pytz
    requests
    tzlocal
    i3ipc
    pydbus
    pygobject3
    pyserial
    setuptools
    dbus-python
    file
  ];

  prePatch = ''
    sed -i -e "s|'file|'${file}/bin/file|" py3status/parse_config.py
    sed -i -e "s|\[\"acpi\"|\[\"${acpi}/bin/acpi\"|" py3status/modules/battery_level.py
    sed -i -e "s|notify-send|${libnotify}/bin/notify-send|" py3status/modules/battery_level.py
    sed -i -e "s|/usr/bin/whoami|${coreutils}/bin/whoami|" py3status/modules/external_script.py
    sed -i -e "s|'amixer|'${alsa-utils}/bin/amixer|" py3status/modules/volume_status.py
    sed -i -e "s|'i3-nagbar|'${i3}/bin/i3-nagbar|" py3status/modules/pomodoro.py
    sed -i -e "s|'free|'${procps}/bin/free|" py3status/modules/sysdata.py
    sed -i -e "s|'sensors|'${lm_sensors}/bin/sensors|" py3status/modules/sysdata.py
    sed -i -e "s|'setxkbmap|'${xorg.setxkbmap}/bin/setxkbmap|" py3status/modules/keyboard_layout.py
    sed -i -e "s|'xset|'${xorg.xset}/bin/xset|" py3status/modules/keyboard_layout.py
  '';

  doCheck = false;

  meta = with lib; {
    description = "Extensible i3status wrapper";
    homepage = "https://github.com/ultrabug/py3status";
    changelog = "https://github.com/ultrabug/py3status/blob/${version}/CHANGELOG";
    license = licenses.bsd3;
    maintainers = with maintainers; [ ];
  };
}