nix-dotfiles/modules/hm/swayidle.nix

30 lines
762 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 -S 10 -u 1000000";
resumeCommand = "${pkgs.brillo}/bin/brillo -e -S 100";
}
{
timeout = 120;
command = "${pkgs.brillo}/bin/brillo -e -S 0; ${pkgs.way-lockscreen}/bin/way-lockscreen";
resumeCommand = "${pkgs.brillo}/bin/brillo -e -S 100";
}
];
};
}