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

29 lines
606 B
Nix
Raw Normal View History

2023-04-09 20:36:56 +05:30
{ pkgs, ... }:
let
swaylock = "${pkgs.swaylock}/bin/swaylock";
hyprctl = "${pkgs.hyprland}/bin/hyprctl";
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
}