Skip to content

Commit

Permalink
feat(nix): switch to hypridle
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulav committed Feb 27, 2024
1 parent e879aa1 commit d9b2a51
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion nix/homes/x86_64-linux/sab@nz/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ with lib.custom; {
rofi = enabled;
kitty = disabled;
swaylock = enabled;
swayidle = enabled;
hypridle = enabled;
waybar = enabled;
wlogout = enabled;
hyprlock = disabled;
Expand Down
16 changes: 11 additions & 5 deletions nix/modules/home/desktop/addons/hypridle/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,27 @@ in {
config = mkIf cfg.enable {
services.hypridle = {
enable = true;
package = pkgs.hypridle;
# package = pkgs.hypridle;

lockCmd = "${getExe config.programs.hypridle.package}";
lockCmd = "${pkgs.swaylock-effects}/bin/swaylock -fF";
afterSleepCmd = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms on";

# 5 min lock, 10min turn the screen off, 20 min suspend
listeners = [
{
timeout = 900;
onTimeout = "${getExe config.programs.hypridle.package}";
timeout = 300;
onTimeout = "${pkgs.swaylock-effects}/bin/swaylock -fF";
}
{
timeout = 1200;
timeout = 600;
onTimeout = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms off";
onResume = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms on";
}
{
timeout = 1200;
onTimeout = "${pkgs.systemd}/bin/systemctl suspend";
onResume = "${getExe' config.wayland.windowManager.hyprland.package "hyprctl"} dispatch dpms on";
}
];
};
};
Expand Down

0 comments on commit d9b2a51

Please sign in to comment.