configuration.nix/home/desktop/wm/addon/swayidle.nix

27 lines
603 B
Nix
Raw Normal View History

2023-05-18 16:11:26 +05:30
{pkgs, ...}: let
2023-04-09 20:36:56 +05:30
swaylock = "${pkgs.swaylock}/bin/swaylock";
hyprctl = "${pkgs.hyprland}/bin/hyprctl";
2023-05-18 16:11:26 +05:30
in {
2023-04-07 19:21:33 +05:30
services.swayidle = {
enable = true;
systemdTarget = "graphical-session.target";
2023-04-07 19:21:33 +05:30
events = [
{
event = "before-sleep";
2023-04-09 20:36:56 +05:30
command = "${swaylock} -f -i /tmp/lockpaper.jpg";
2023-04-07 19:21:33 +05:30
}
];
timeouts = [
{
timeout = 600;
2023-04-09 20:36:56 +05:30
command = "${swaylock} -f -i /tmp/lockpaper.jpg";
}
{
timeout = 900;
command = "${hyprctl} dispatch dpms off";
resumeCommand = "${hyprctl} dispatch dpms on";
2023-04-07 19:21:33 +05:30
}
];
};
2023-03-15 22:11:59 +05:30
}