2024-08-02 17:58:08 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
cfg = config.ar.home;
|
|
|
|
in {
|
|
|
|
config = lib.mkIf cfg.services.pipewire-inhibit.enable {
|
|
|
|
systemd.user.services.pipewire-inhibit-idle = {
|
|
|
|
Unit = {
|
|
|
|
After = "graphical-session.target";
|
2024-08-12 10:17:21 -04:00
|
|
|
BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target";
|
2024-08-02 17:58:08 -04:00
|
|
|
Description = "inhibit idle when audio is playing with Pipewire.";
|
|
|
|
PartOf = "graphical-session.target";
|
|
|
|
};
|
|
|
|
|
|
|
|
Service = {
|
|
|
|
ExecStart = lib.getExe pkgs.wayland-pipewire-idle-inhibit;
|
2024-08-11 23:43:48 -04:00
|
|
|
Restart = "no";
|
2024-08-02 17:58:08 -04:00
|
|
|
};
|
|
|
|
|
2024-08-12 10:17:21 -04:00
|
|
|
Install.WantedBy = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target";
|
2024-08-02 17:58:08 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|