nix-dotfiles/modules/hm/swayidle.nix

23 lines
732 B
Nix

{ pkgs, ... }: {
home.packages = builtins.attrValues { inherit (pkgs) brillo; };
services.swayidle = {
enable = true;
events = [
{ event = "before-sleep"; command = "${pkgs.way-lockscreen}/bin/way-lockscreen"; }
{ event = "lock"; command = "${pkgs.way-lockscreen}/bin/way-lockscreen"; }
];
timeouts = [
{
timeout = 60;
command = "${pkgs.brillo}/bin/brillo -e -O; ${pkgs.brillo}/bin/brillo -e -S 30";
resumeCommand = "${pkgs.brillo}/bin/brillo -e -I";
}
{
timeout = 120;
command = "${pkgs.brillo}/bin/brillo -e -S 0; ${pkgs.way-lockscreen}/bin/way-lockscreen";
resumeCommand = "${pkgs.brillo}/bin/brillo -e -I";
}
];
};
}