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-09-15 11:00:09 -04:00
|
|
|
BindsTo = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target" ++ lib.optional (cfg.desktop.river.enable) "river-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-09-15 11:00:09 -04:00
|
|
|
Install.WantedBy = lib.optional (cfg.desktop.hyprland.enable) "hyprland-session.target" ++ lib.optional (cfg.desktop.sway.enable) "sway-session.target" ++ lib.optional (cfg.desktop.river.enable) "river-session.target";
|
2024-08-02 17:58:08 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|