snowflake/home/wayland/services/hypridle.nix

27 lines
687 B
Nix
Raw Normal View History

2024-03-07 03:54:42 -05:00
{
2024-04-22 16:16:03 -04:00
inputs,
2024-03-07 03:54:42 -05:00
pkgs,
lib,
2024-04-22 16:16:03 -04:00
config,
2024-03-07 03:54:42 -05:00
...
}: {
2024-04-22 16:16:03 -04:00
imports = [inputs.hypridle.homeManagerModules.default];
2024-03-07 03:54:42 -05:00
services.hypridle = {
enable = true;
ignoreDbusInhibit = false;
lockCmd = lib.getExe config.programs.hyprlock.package;
beforeSleepCmd = "${pkgs.systemd}/bin/loginctl lock-session";
listeners = [
{
2024-04-17 23:53:39 -04:00
timeout = 400;
2024-03-07 03:54:42 -05:00
onTimeout = "${lib.getExe config.programs.hyprlock.package}";
}
{
2024-04-17 23:53:39 -04:00
timeout = 460;
2024-03-07 03:54:42 -05:00
onTimeout = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off";
onResume = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on";
}
];
};
}