configuration.nix/home/wm/addon/swayidle.nix
2024-01-04 21:51:25 +05:30

28 lines
658 B
Nix

{ config, ... }:
let
swaylock = "${config.programs.swaylock.package}/bin/swaylock";
hyprctl = "${config.wayland.windowManager.hyprland.package}/bin/hyprctl";
in
{
services.swayidle = {
enable = true;
systemdTarget = "graphical-session.target";
events = [
{
event = "before-sleep";
command = "${swaylock} -f -i /tmp/wallpaper.jpg";
}
];
timeouts = [
{
timeout = 600;
command = "${swaylock} -f -i /tmp/wallpaper.jpg";
}
{
timeout = 900;
command = "${hyprctl} dispatch dpms off";
resumeCommand = "${hyprctl} dispatch dpms on";
}
];
};
}