2024-03-31 14:19:35 +00:00
|
|
|
{
|
|
|
|
inputs,
|
|
|
|
pkgs,
|
2024-06-16 13:49:52 +00:00
|
|
|
lib,
|
2024-03-31 14:19:35 +00:00
|
|
|
...
|
|
|
|
}: let
|
|
|
|
hyprland_pkg = inputs.hyprland.packages."${pkgs.system}".hyprland;
|
|
|
|
in {
|
2023-12-30 17:52:48 +00:00
|
|
|
services.swayidle = {
|
|
|
|
enable = true;
|
|
|
|
systemdTarget = "hyprland-session.target";
|
|
|
|
events = [
|
|
|
|
{
|
|
|
|
event = "after-resume";
|
2024-03-31 14:19:35 +00:00
|
|
|
command = "${hyprland_pkg}/bin/hyprctl dispatch dpms on";
|
2023-12-30 17:52:48 +00:00
|
|
|
}
|
|
|
|
{
|
|
|
|
event = "before-sleep";
|
2024-06-16 13:49:52 +00:00
|
|
|
command = "${lib.getExe pkgs.swaylock-effects} -f";
|
2023-12-30 17:52:48 +00:00
|
|
|
}
|
|
|
|
];
|
|
|
|
timeouts = [
|
|
|
|
{
|
|
|
|
timeout = 120;
|
2024-06-16 13:49:52 +00:00
|
|
|
command = "${lib.getExe pkgs.swaylock-effects} -f --grace 3";
|
2023-12-30 17:52:48 +00:00
|
|
|
}
|
|
|
|
{
|
|
|
|
timeout = 150;
|
2024-03-31 14:19:35 +00:00
|
|
|
command = "${hyprland_pkg}/bin/hyprctl dispatch dpms off";
|
2023-12-30 17:52:48 +00:00
|
|
|
}
|
|
|
|
{
|
|
|
|
timeout = 300;
|
|
|
|
command = "${pkgs.systemd}/bin/systemctl suspend";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
}
|