6 python3Packages.buildPythonApplication rec {
7 pname = "sway-assign-cgroups";
9 src = fetchFromGitHub {
11 repo = "sway-systemd";
13 sha256 = "sha256-wznYE1/lVJtvf5Nq96gbPYisxc2gWLahVydwcH1vwoQ=";
17 propagatedBuildInputs = with python3Packages; [ dbus-next i3ipc psutil tenacity xlib ];
22 cp src/assign-cgroups.py $out/bin/
27 description = "Place GUI applications into systemd scopes for systemd-oomd compatibility";
28 mainProgram = "assign-cgroups.py";
30 Automatically assign a dedicated systemd scope to the GUI applications
31 launched in the same cgroup as the compositor. This could be helpful for
32 implementing cgroup-based resource management and would be necessary when
33 `systemd-oomd` is in use.
35 Limitations: The script is using i3ipc window:new event to detect application
36 launches and would fail to detect background apps or special surfaces.
37 Therefore it's recommended to supplement the script with use of systemd user
38 services for such background apps.
40 license = licenses.mit;
41 platforms = platforms.linux;
42 maintainers = with maintainers; [ nickhu ];