1{
2 lib,
3 buildPythonPackage,
4 acpi,
5 alsa-utils,
6 coreutils,
7 dbus-python,
8 fetchPypi,
9 file,
10 hatchling,
11 i3,
12 i3ipc,
13 libnotify,
14 lm_sensors,
15 procps,
16 pydbus,
17 pygobject3,
18 pyserial,
19 pytz,
20 requests,
21 setuptools,
22 tzlocal,
23 xorg,
24}:
25
26buildPythonPackage rec {
27 pname = "py3status";
28 version = "3.58";
29 pyproject = true;
30
31 src = fetchPypi {
32 inherit pname version;
33 hash = "sha256-SJScEz9WsqB0jRAHmUHpmnAbuqnRnHUUgc1rDN0tScw=";
34 };
35
36 nativeBuildInputs = [ hatchling ];
37
38 propagatedBuildInputs = [
39 pytz
40 requests
41 tzlocal
42 i3ipc
43 pydbus
44 pygobject3
45 pyserial
46 setuptools
47 dbus-python
48 file
49 ];
50
51 prePatch = ''
52 sed -i -e "s|'file|'${file}/bin/file|" py3status/parse_config.py
53 sed -i -e "s|\[\"acpi\"|\[\"${acpi}/bin/acpi\"|" py3status/modules/battery_level.py
54 sed -i -e "s|notify-send|${libnotify}/bin/notify-send|" py3status/modules/battery_level.py
55 sed -i -e "s|/usr/bin/whoami|${coreutils}/bin/whoami|" py3status/modules/external_script.py
56 sed -i -e "s|'amixer|'${alsa-utils}/bin/amixer|" py3status/modules/volume_status.py
57 sed -i -e "s|'i3-nagbar|'${i3}/bin/i3-nagbar|" py3status/modules/pomodoro.py
58 sed -i -e "s|'free|'${procps}/bin/free|" py3status/modules/sysdata.py
59 sed -i -e "s|'sensors|'${lm_sensors}/bin/sensors|" py3status/modules/sysdata.py
60 sed -i -e "s|'setxkbmap|'${xorg.setxkbmap}/bin/setxkbmap|" py3status/modules/keyboard_layout.py
61 sed -i -e "s|'xset|'${xorg.xset}/bin/xset|" py3status/modules/keyboard_layout.py
62 '';
63
64 doCheck = false;
65
66 meta = with lib; {
67 description = "Extensible i3status wrapper";
68 homepage = "https://github.com/ultrabug/py3status";
69 changelog = "https://github.com/ultrabug/py3status/blob/${version}/CHANGELOG";
70 license = licenses.bsd3;
71 maintainers = [ ];
72 };
73}